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-
191import os
202import inspect
213import sys
3719 "sphinx.ext.mathjax" ,
3820 "sphinx_design" ,
3921 "sphinx.ext.intersphinx" ,
22+ "ablog" ,
4023 "myst_nb" ,
4124 "generate_gallery" ,
4225]
9679# List of directories, relative to source directories, that shouldn't be
9780# searched for source files.
9881exclude_dirs = ["images" , "scripts" , "sandbox" ]
82+ exclude_patterns = ['page_footer.md' , '**/*.myst.md' ]
9983
10084# The reST default role (used for this markup: `text`) to use for all
10185# documents.
160144 "type" : "fontawesome" ,
161145 },
162146 ],
147+ "secondary_sidebar_items" : ["page-toc" , "edit-this-page" , "sourcelink" , "donate" ],
148+ "navbar_start" : ["navbar-logo" ],
149+ "article_header_end" : ["nb-badges" ],
150+ "article_footer_items" : ["rendered_citation.html" ],
163151}
164152html_context = {
153+ "github_url" : "https://github.com" ,
165154 "github_user" : "pymc-devs" ,
166155 "github_repo" : "pytensor" ,
167- "github_version" : "main" ,
156+ "github_version" : version if "." in rtd_version else "main" ,
157+ "sandbox_repo" : f"pymc-devs/pymc-sandbox/{ version } " ,
168158 "doc_path" : "doc" ,
169159 "default_mode" : "light" ,
170160}
171161
162+ # Add any paths that contain custom static files (such as style sheets) here,
163+ # relative to this directory. They are copied after the builtin static files,
164+ # so a file named "default.css" will overwrite the builtin "default.css".
165+ # html_static_path = ["../_static"]
166+ html_extra_path = ["_thumbnails" , 'images' , "robots.txt" ]
167+ templates_path = [".templates" ]
172168
173169# The name for this set of Sphinx documents. If None, it defaults to
174170# "<project> v<release> documentation".
@@ -311,18 +307,50 @@ def find_source():
311307]
312308myst_dmath_double_inline = True
313309
310+ citation_code = f"""
311+ ```bibtex
312+ @incollection{{citekey,
313+ author = "<notebook authors, see above>",
314+ title = "<notebook title>",
315+ editor = "Pytensor Team",
316+ booktitle = "Pytensor Examples",
317+ }}
318+ ```
319+ """
320+
314321myst_substitutions = {
315322 "pip_dependencies" : "{{ extra_dependencies }}" ,
316323 "conda_dependencies" : "{{ extra_dependencies }}" ,
317324 "extra_install_notes" : "" ,
325+ "citation_code" : citation_code ,
318326}
319327
320328nb_execution_mode = "off"
321329nbsphinx_execute = "never"
322330nbsphinx_allow_errors = True
323331
332+ rediraffe_redirects = {
333+ "index.md" : "gallery.md" ,
334+ }
324335
325336# -- Bibtex config -------------------------------------------------
326337bibtex_bibfiles = ["references.bib" ]
327338bibtex_default_style = "unsrt"
328339bibtex_reference_style = "author_year"
340+
341+
342+ # -- ablog config -------------------------------------------------
343+ blog_baseurl = "https://pytensor.readthedocs.io/en/latest/index.html"
344+ blog_title = "Pytensor Examples"
345+ blog_path = "blog"
346+ blog_authors = {
347+ "contributors" : ("Pytensor Contributors" , "https://pytensor.readthedocs.io" ),
348+ }
349+ blog_default_author = "contributors"
350+ post_show_prev_next = False
351+ fontawesome_included = True
352+ # post_redirect_refresh = 1
353+ # post_auto_image = 1
354+ # post_auto_excerpt = 2
355+
356+ notfound_urls_prefix = "/projects/examples/en/latest/"
0 commit comments