diff --git a/.gitignore b/.gitignore index 4f1618a34596b4cf72608fdb2ab26c1e37b6aca3..b73b75c203451e68d360e5fef4afc0769538afb9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.pyc *.pyo build +_build *.prof siteconf.py doc/hedge-notes.pdf diff --git a/doc/Makefile b/doc/Makefile index e59ebe6ce5ab290e519929c162495484ab2c0962..747126b3bf43d3a4e7b1f016351124b881936c41 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,70 +1,20 @@ -# Makefile for Sphinx documentation +# Minimal makefile for Sphinx documentation # -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = python3 `which sphinx-build` -PAPER = - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help clean html web pickle htmlhelp latex changes linkcheck +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= -n +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build +# Put it first so that "make" without argument is like "make help". help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " pickle to make pickle files (usable by e.g. sphinx-web)" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview over all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - -clean: - -rm -rf build/* - -html: - mkdir -p build/html build/doctrees source/.static - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html - @echo - @echo "Build finished. The HTML pages are in build/html." - -pickle: - mkdir -p build/pickle build/doctrees - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle - @echo - @echo "Build finished; now you can process the pickle files or run" - @echo " sphinx-web build/pickle" - @echo "to start the sphinx-web server." - -web: pickle - -htmlhelp: - mkdir -p build/htmlhelp build/doctrees - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in build/htmlhelp." - -latex: - mkdir -p build/latex build/doctrees - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex - @echo - @echo "Build finished; the LaTeX files are in build/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -changes: - mkdir -p build/changes build/doctrees - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes - @echo - @echo "The overview file is in build/changes." +.PHONY: help Makefile -linkcheck: - mkdir -p build/linkcheck build/doctrees - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in build/linkcheck/output.txt." +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/source/array.rst b/doc/array.rst similarity index 100% rename from doc/source/array.rst rename to doc/array.rst diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..f2482ba24cfacb905a0261165910a3b62720204b --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,25 @@ +from urllib.request import urlopen + +_conf_url = \ + "https://raw.githubusercontent.com/inducer/sphinxconfig/main/sphinxconfig.py" +with urlopen(_conf_url) as _inf: + exec(compile(_inf.read(), _conf_url, "exec"), globals()) + +copyright = "2008-21, Andreas Kloeckner" + +ver_dic = {} +exec( + compile( + open("../pycuda/__init__.py").read(), "../pycuda/__init__.py", "exec" + ), + ver_dic, +) +version = ".".join(str(x) for x in ver_dic["VERSION"]) +# The full version, including alpha/beta/rc tags. +release = ver_dic["VERSION_TEXT"] + +intersphinx_mapping = { + "https://docs.python.org/3": None, + "https://numpy.org/doc/stable/": None, + "https://documen.tician.de/codepy/": None, +} diff --git a/doc/source/driver.rst b/doc/driver.rst similarity index 100% rename from doc/source/driver.rst rename to doc/driver.rst diff --git a/doc/source/gl.rst b/doc/gl.rst similarity index 100% rename from doc/source/gl.rst rename to doc/gl.rst diff --git a/doc/source/index.rst b/doc/index.rst similarity index 100% rename from doc/source/index.rst rename to doc/index.rst diff --git a/doc/source/install.rst b/doc/install.rst similarity index 100% rename from doc/source/install.rst rename to doc/install.rst diff --git a/doc/source/metaprog.rst b/doc/metaprog.rst similarity index 100% rename from doc/source/metaprog.rst rename to doc/metaprog.rst diff --git a/doc/source/misc.rst b/doc/misc.rst similarity index 100% rename from doc/source/misc.rst rename to doc/misc.rst diff --git a/doc/source/conf.py b/doc/source/conf.py deleted file mode 100644 index 2fb39ed0f21a6a746702393acf23fc2ec18b9b06..0000000000000000000000000000000000000000 --- a/doc/source/conf.py +++ /dev/null @@ -1,52 +0,0 @@ -extensions = [ - "sphinx.ext.intersphinx", - "sphinx.ext.mathjax", - "sphinx_copybutton", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# The suffix of source filenames. -source_suffix = ".rst" - -# The master toctree document. -master_doc = "index" - -# General substitutions. -project = "PyCUDA" -copyright = "2008-20, Andreas Kloeckner" - -# The default replacements for |version| and |release|, also used in various -# other places throughout the built documents. -# -# The short X.Y version. -ver_dic = {} -exec( - compile( - open("../../pycuda/__init__.py").read(), "../../pycuda/__init__.py", "exec" - ), - ver_dic, -) -version = ".".join(str(x) for x in ver_dic["VERSION"]) -# The full version, including alpha/beta/rc tags. -release = ver_dic["VERSION_TEXT"] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - - -# Options for HTML output -# ----------------------- - -html_theme = "furo" - - -intersphinx_mapping = { - "https://docs.python.org/3": None, - "https://numpy.org/doc/stable/": None, - "https://documen.tician.de/codepy/": None, -} - -autoclass_content = "class" -autodoc_typehints = "description" diff --git a/doc/source/tutorial.rst b/doc/tutorial.rst similarity index 100% rename from doc/source/tutorial.rst rename to doc/tutorial.rst diff --git a/doc/upload-docs.sh b/doc/upload-docs.sh index d5bba8550d24bf3c4e5d14517af3a0b32baec60e..5914600b83b2f82af12d48ed73f3525bcc1b2d4b 100755 --- a/doc/upload-docs.sh +++ b/doc/upload-docs.sh @@ -1,3 +1,3 @@ #! /bin/sh -rsync --verbose --archive --delete build/html/* doc-upload:doc/pycuda +rsync --verbose --archive --delete _build/html/* doc-upload:doc/pycuda diff --git a/doc/source/util.rst b/doc/util.rst similarity index 100% rename from doc/source/util.rst rename to doc/util.rst