Skip to content

Commit 4a93bae

Browse files
committed
Add basic documentation site
1 parent e48e33b commit 4a93bae

File tree

8 files changed

+111
-3
lines changed

8 files changed

+111
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,6 @@ compile_commands.json
142142
/quaddtype/subprojects/qblas/
143143
/quaddtype/subprojects/sleef/
144144
.wraplock
145+
146+
# docs
147+
/quaddtype/docs/_build/

quaddtype/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ np.array([1,2,3], dtype=QuadPrecDType("longdouble"))
2525

2626
## Installation from source
2727

28-
#### Prerequisites
28+
### Prerequisites
2929

3030
- **gcc/clang**
3131
- **CMake** (≥3.15)
@@ -43,7 +43,7 @@ python3 -m venv temp
4343
source temp/bin/activate
4444

4545
# Install the package
46-
pip install numpy pytest
46+
pip install numpy pytest meson-python
4747

4848
# To build without QBLAS (default for MSVC)
4949
# export CFLAGS="-DDISABLE_QUADBLAS"
@@ -167,4 +167,4 @@ This is a development feature to help detect threading issues. To build `numpy-q
167167
export CXXFLAGS="-fsanitize=thread -g -O0"
168168
export LDFLAGS="-fsanitize=thread"
169169
python -m pip install . -vv --no-build-isolation -Csetup-args=-Db_sanitize=thread
170-
```
170+
```

quaddtype/docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

quaddtype/docs/api_docs.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
NumPy QuadDType API Documentation
2+
=================================
3+
4+
.. automodule:: numpy_quaddtype
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

quaddtype/docs/conf.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'NumPy QuadDType'
10+
copyright = '2025, NumPy Community'
11+
author = 'NumPy Community'
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = [
17+
'sphinx.ext.autodoc',
18+
'sphinx.ext.napoleon',
19+
'myst_parser',
20+
]
21+
22+
templates_path = ['_templates']
23+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
24+
25+
# -- Options for HTML output -------------------------------------------------
26+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
27+
28+
html_theme = 'pydata_sphinx_theme'
29+
html_static_path = ['_static']

quaddtype/docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```{include} ../README.md
2+
```
3+
4+
```{toctree}
5+
:hidden:
6+
7+
api_docs.rst
8+
```

quaddtype/docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

quaddtype/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ test = [
3737
"pytest-run-parallel"
3838
]
3939

40+
docs = [
41+
"sphinx",
42+
"pydata-sphinx-theme",
43+
"myst-parser",
44+
]
45+
4046
[project.urls]
4147
Repository = "https://github.com/numpy/numpy-user-dtypes"
4248
Documentation = "https://github.com/numpy/numpy-user-dtypes/tree/main/quaddtype"

0 commit comments

Comments
 (0)