-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
conf.py
183 lines (152 loc) · 5.3 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from pathlib import Path
# -- Project information -----------------------------------------------------
project = "PyMC project website"
copyright = "2022, PyMC Team"
author = "PyMC Team"
version = ""
release = ""
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"myst_nb",
"sphinx_copybutton",
"sphinx_design",
"ablog",
"sphinxext.opengraph",
"sphinx_codeautolink",
"notfound.extension",
"jupyterlite_sphinx",
"sphinxext.rediraffe",
"sphinx_sitemap",
]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
"Thumbs.db",
".DS_Store",
".ipynb_checkpoints",
"_build",
"jupyter_execute",
"README.md",
]
# -- Options for extensions
nb_execution_mode = "auto"
nb_execution_excludepatterns = ["*.ipynb"]
myst_enable_extensions = ["colon_fence", "deflist", "dollarmath", "amsmath"]
intersphinx_mapping = {
"aesara": ("https://aesara.readthedocs.io/en/latest/", None),
"arviz": ("https://python.arviz.org/en/latest/", None),
"bambi": ("https://bambinos.github.io/bambi", None),
"mpl": ("https://matplotlib.org/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
"pytensor": ("https://pytensor.readthedocs.io/en/latest/", None),
"nb": ("https://www.pymc.io/projects/examples/en/latest/", None),
"pmx": ("https://www.pymc.io/projects/experimental/en/latest/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
}
blog_baseurl = "https://pymc.io"
blog_title = "PyMC project website"
blog_path = "blog"
blog_authors = {
"contributors": ("PyMC Contributors", "https://pymc.io"),
"oriol": ("Oriol Abril Pla", "https://oriolabril.github.io"),
}
blog_default_author = "contributors"
fontawesome_included = True
notfound_urls_prefix = ""
rediraffe_redirects = {
"index.md": "welcome.md",
}
def remove_catalogs(app):
"""
This removes the tag, category and archive pages so ablog rewrites them.
They need to be present initially for the toctree and sidebar to work.
"""
app.env.project.docnames -= {"blog/tag", "blog/category", "blog/archive"}
yield "blog", {}, "layout.html"
def remove_index(app):
"""
This removes the index pages so rediraffe generates the redirect placeholder
It needs to be present initially for the toctree as it defines the navbar.
"""
index_file = Path(app.outdir) / "index.html"
index_file.unlink()
app.env.project.docnames -= {"index"}
yield "", {}, "layout.html"
def setup(app):
"""
Add extra steps to sphinx build
"""
app.connect("html-collect-pages", remove_catalogs, 100)
app.connect("html-collect-pages", remove_index, 100)
ogp_site_url = "https://www.pymc.io"
ogp_image = "https://www.pymc.io/_static/PyMC.jpg"
ogp_use_first_image = True
jupyterlite_bind_ipynb_suffix = False
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pymc_sphinx_theme"
html_baseurl = "https://www.pymc.io/"
sitemap_url_scheme = "{link}"
html_extra_path = ["robots.txt", "sitemapindex.xml"]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_theme_options = {
"show_nav_level": 2,
"navbar_start": ["navbar-logo"],
}
html_context = {
"github_user": "pymc-devs",
"github_repo": "pymc.io",
"github_version": "main",
"doc_path": ".",
"default_mode": "light",
}
html_logo = "_static/PyMC.jpg"
html_favicon = "_static/favicon.ico"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_title = "PyMC project website"
html_sidebars = {
"blog/tag": [
"ablog/tagcloud.html",
"sidebar-nav-bs.html",
],
"blog/category": [
"ablog/categories.html",
"sidebar-nav-bs.html",
],
"blog/archive": [
"ablog/archives.html",
"sidebar-nav-bs.html",
],
"blog/*": [
"ablog/postcard.html",
"sidebar-nav-bs.html",
],
"blog": ["sidebar-nav-bs.html"],
"[!blog]**": ["sidebar-nav-bs.html"],
}