|
1 |
| -# pytensor documentation build configuration file, created by |
2 |
| -# sphinx-quickstart on Tue Oct 7 16:34:06 2008. |
3 |
| -# |
4 |
| -# This file is execfile()d with the current directory set to its containing |
5 |
| -# directory. |
6 |
| -# |
7 |
| -# The contents of this file are pickled, so don't put values in the namespace |
8 |
| -# that aren't pickleable (module imports are okay, they're removed |
9 |
| -# automatically). |
10 |
| -# |
11 |
| -# All configuration values have a default value; values that are commented out |
12 |
| -# serve to show the default value. |
13 |
| - |
14 |
| -# If your extensions are in another directory, add it here. If the directory |
15 |
| -# is relative to the documentation root, use Path.absolute to make it |
16 |
| -# absolute, like shown here. |
17 |
| -# sys.path.append(str(Path("some/directory").absolute())) |
18 |
| - |
19 | 1 | import os
|
20 | 2 | import inspect
|
21 | 3 | import sys
|
22 | 4 | import pytensor
|
| 5 | +from pathlib import Path |
| 6 | + |
| 7 | +sys.path.insert(0, str(Path("..").resolve() / "scripts")) |
23 | 8 |
|
24 | 9 | # General configuration
|
25 | 10 | # ---------------------
|
26 |
| - |
27 |
| -# Add any Sphinx extension module names here, as strings. They can be |
28 |
| -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
29 | 11 | extensions = [
|
30 | 12 | "sphinx.ext.autodoc",
|
31 | 13 | "sphinx.ext.todo",
|
|
34 | 16 | "sphinx.ext.linkcode",
|
35 | 17 | "sphinx.ext.mathjax",
|
36 | 18 | "sphinx_design",
|
37 |
| - "sphinx.ext.intersphinx" |
| 19 | + "sphinx.ext.intersphinx", |
| 20 | + "sphinx.ext.autosummary", |
| 21 | + "sphinx.ext.autosectionlabel", |
| 22 | + "ablog", |
| 23 | + "myst_nb", |
| 24 | + "generate_gallery", |
| 25 | + "sphinx_sitemap", |
38 | 26 | ]
|
39 | 27 |
|
| 28 | +# Don't auto-generate summary for class members. |
| 29 | +numpydoc_show_class_members = False |
| 30 | +autosummary_generate = True |
| 31 | +autodoc_typehints = "none" |
| 32 | +remove_from_toctrees = ["**/classmethods/*"] |
| 33 | + |
| 34 | + |
40 | 35 | intersphinx_mapping = {
|
41 | 36 | "jax": ("https://jax.readthedocs.io/en/latest", None),
|
42 | 37 | "numpy": ("https://numpy.org/doc/stable", None),
|
|
92 | 87 | # List of directories, relative to source directories, that shouldn't be
|
93 | 88 | # searched for source files.
|
94 | 89 | exclude_dirs = ["images", "scripts", "sandbox"]
|
| 90 | +exclude_patterns = ['page_footer.md', '**/*.myst.md'] |
95 | 91 |
|
96 | 92 | # The reST default role (used for this markup: `text`) to use for all
|
97 | 93 | # documents.
|
|
115 | 111 | # Options for HTML output
|
116 | 112 | # -----------------------
|
117 | 113 |
|
118 |
| -# The style sheet to use for HTML and HTML Help pages. A file of that name |
119 |
| -# must exist either in Sphinx' static/ path, or in one of the custom paths |
120 |
| -# given in html_static_path. |
121 |
| -# html_style = 'default.css' |
122 |
| -# html_theme = 'sphinxdoc' |
| 114 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 115 | +# a list of builtin themes. |
| 116 | +html_theme = "pymc_sphinx_theme" |
| 117 | +html_logo = "images/PyTensor_RGB.svg" |
| 118 | + |
| 119 | +html_baseurl = "https://pytensor.readthedocs.io" |
| 120 | +sitemap_url_scheme = f"{{lang}}{rtd_version}/{{link}}" |
123 | 121 |
|
124 |
| -# html4_writer added to Fix colon & whitespace misalignment |
125 |
| -# https://github.com/readthedocs/sphinx_rtd_theme/issues/766#issuecomment-513852197 |
126 |
| -# https://github.com/readthedocs/sphinx_rtd_theme/issues/766#issuecomment-629666319 |
127 |
| -# html4_writer = False |
128 | 122 |
|
129 |
| -html_logo = "images/PyTensor_RGB.svg" |
130 |
| -html_theme = "pymc_sphinx_theme" |
131 | 123 | html_theme_options = {
|
132 | 124 | "use_search_override": False,
|
133 | 125 | "icon_links": [
|
|
156 | 148 | "type": "fontawesome",
|
157 | 149 | },
|
158 | 150 | ],
|
| 151 | + "secondary_sidebar_items": ["page-toc", "edit-this-page", "sourcelink", "donate"], |
| 152 | + "navbar_start": ["navbar-logo"], |
| 153 | + "article_header_end": ["nb-badges"], |
| 154 | + "article_footer_items": ["rendered_citation.html"], |
159 | 155 | }
|
160 | 156 | html_context = {
|
| 157 | + "github_url": "https://github.com", |
161 | 158 | "github_user": "pymc-devs",
|
162 | 159 | "github_repo": "pytensor",
|
163 |
| - "github_version": "main", |
| 160 | + "github_version": version if "." in rtd_version else "main", |
| 161 | + "sandbox_repo": f"pymc-devs/pymc-sandbox/{version}", |
164 | 162 | "doc_path": "doc",
|
165 | 163 | "default_mode": "light",
|
166 | 164 | }
|
167 | 165 |
|
| 166 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 167 | +# relative to this directory. They are copied after the builtin static files, |
| 168 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 169 | +# html_static_path = ["../_static"] |
| 170 | +html_extra_path = ["_thumbnails", 'images', "robots.txt"] |
| 171 | +templates_path = [".templates"] |
168 | 172 |
|
169 | 173 | # The name for this set of Sphinx documents. If None, it defaults to
|
170 | 174 | # "<project> v<release> documentation".
|
@@ -295,3 +299,62 @@ def find_source():
|
295 | 299 |
|
296 | 300 | # If false, no module index is generated.
|
297 | 301 | # latex_use_modindex = True
|
| 302 | + |
| 303 | + |
| 304 | +# -- MyST config ------------------------------------------------- |
| 305 | +myst_enable_extensions = [ |
| 306 | + "colon_fence", |
| 307 | + "deflist", |
| 308 | + "dollarmath", |
| 309 | + "amsmath", |
| 310 | + "substitution", |
| 311 | +] |
| 312 | +myst_dmath_double_inline = True |
| 313 | + |
| 314 | +citation_code = f""" |
| 315 | +```bibtex |
| 316 | +@incollection{{citekey, |
| 317 | + author = "<notebook authors, see above>", |
| 318 | + title = "<notebook title>", |
| 319 | + editor = "Pytensor Team", |
| 320 | + booktitle = "Pytensor Examples", |
| 321 | +}} |
| 322 | +``` |
| 323 | +""" |
| 324 | + |
| 325 | +myst_substitutions = { |
| 326 | + "pip_dependencies": "{{ extra_dependencies }}", |
| 327 | + "conda_dependencies": "{{ extra_dependencies }}", |
| 328 | + "extra_install_notes": "", |
| 329 | + "citation_code": citation_code, |
| 330 | +} |
| 331 | + |
| 332 | +nb_execution_mode = "off" |
| 333 | +nbsphinx_execute = "never" |
| 334 | +nbsphinx_allow_errors = True |
| 335 | + |
| 336 | +rediraffe_redirects = { |
| 337 | + "index.md": "gallery.md", |
| 338 | +} |
| 339 | + |
| 340 | +# -- Bibtex config ------------------------------------------------- |
| 341 | +bibtex_bibfiles = ["references.bib"] |
| 342 | +bibtex_default_style = "unsrt" |
| 343 | +bibtex_reference_style = "author_year" |
| 344 | + |
| 345 | + |
| 346 | +# -- ablog config ------------------------------------------------- |
| 347 | +blog_baseurl = "https://pytensor.readthedocs.io/en/latest/index.html" |
| 348 | +blog_title = "Pytensor Examples" |
| 349 | +blog_path = "blog" |
| 350 | +blog_authors = { |
| 351 | + "contributors": ("Pytensor Contributors", "https://pytensor.readthedocs.io"), |
| 352 | +} |
| 353 | +blog_default_author = "contributors" |
| 354 | +post_show_prev_next = False |
| 355 | +fontawesome_included = True |
| 356 | +# post_redirect_refresh = 1 |
| 357 | +# post_auto_image = 1 |
| 358 | +# post_auto_excerpt = 2 |
| 359 | + |
| 360 | +# notfound_urls_prefix = "" |
0 commit comments