|
1 | 1 | #!/usr/bin/env python |
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 | # |
4 | | -# picachooser documentation build configuration file, |
5 | | -# copied from rapidtide |
| 4 | +# picachooser documentation build configuration file, copied from |
| 5 | +# capcalc 8/21/2025 |
6 | 6 | # |
7 | 7 | # This file is execfile()d with the current directory set to its |
8 | 8 | # containing dir. |
|
17 | 17 | import sys |
18 | 18 | from datetime import datetime |
19 | 19 |
|
20 | | -from m2r import MdInclude |
21 | | - |
22 | 20 | # If extensions (or modules to document with autodoc) are in another directory, |
23 | 21 | # add these directories to sys.path here. If the directory is relative to the |
24 | 22 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
|
46 | 44 |
|
47 | 45 | on_rtd = os.environ.get("READTHEDOCS", None) == "True" |
48 | 46 |
|
| 47 | + |
49 | 48 | from github_link import make_linkcode_resolve |
50 | 49 |
|
51 | 50 | import picachooser |
|
66 | 65 | # ones. |
67 | 66 | extensions = [ |
68 | 67 | "sphinx.ext.todo", |
| 68 | + "sphinx.ext.autosectionlabel", |
69 | 69 | "sphinx.ext.coverage", |
70 | 70 | "sphinx.ext.autodoc", |
71 | 71 | "sphinx.ext.napoleon", |
72 | 72 | "sphinxarg.ext", |
73 | 73 | "sphinx.ext.intersphinx", |
74 | 74 | "sphinx.ext.autosummary", |
75 | 75 | "sphinx.ext.doctest", |
| 76 | + "myst_parser", |
76 | 77 | "numpydoc", |
77 | 78 | "sphinx.ext.ifconfig", |
78 | 79 | "sphinx.ext.linkcode", |
79 | | - "recommonmark", |
80 | 80 | "sphinx_gallery.gen_gallery", |
| 81 | + "sphinxcontrib.bibtex", |
81 | 82 | ] |
82 | 83 |
|
83 | 84 | from distutils.version import LooseVersion |
|
94 | 95 |
|
95 | 96 | # The suffix(es) of source filenames. |
96 | 97 | # You can specify multiple suffix as a list of string: |
97 | | -# source_suffix = ['.rst', '.md'] |
98 | | -source_suffix = ".rst" |
| 98 | +source_suffix = [".rst"] |
99 | 99 |
|
100 | 100 | # The encoding of source files. |
101 | 101 | # source_encoding = 'utf-8-sig' |
|
105 | 105 |
|
106 | 106 | # General information about the project. |
107 | 107 | project = "picachooser" |
108 | | -copyright = "2020-" + datetime.today().strftime("%Y") + ", Blaise Frederick" |
| 108 | +copyright = "2019-" + datetime.today().strftime("%Y") + ", Blaise Frederick" |
109 | 109 | author = "Blaise Frederick" |
110 | 110 |
|
111 | 111 | # The version info for the project you're documenting, acts as replacement for |
112 | 112 | # |version| and |release|, also used in various other places throughout the |
113 | 113 | # built documents. |
114 | 114 | # |
115 | 115 | # The short X.Y version. |
116 | | -import picachooser.util as pica_util |
| 116 | +import picachooser.util as tide_util |
117 | 117 |
|
118 | | -version = pica_util.version()[0].replace("v", "").split("+")[0] |
| 118 | +version = tide_util.version()[0].replace("v", "").split("+")[0] |
119 | 119 | # The full version, including alpha/beta/rc tags. |
120 | 120 | release = version |
121 | 121 |
|
|
124 | 124 | # |
125 | 125 | # This is also used if you do content translation via gettext catalogs. |
126 | 126 | # Usually you set "language" from the command line for these cases. |
127 | | -language = None |
| 127 | +language = "en" |
128 | 128 |
|
129 | 129 | # There are two options for replacing |today|: either, you set today to some |
130 | 130 | # non-false value, then it is used: |
|
207 | 207 | # https://github.com/rtfd/sphinx_rtd_theme/issues/117 |
208 | 208 | def setup(app): |
209 | 209 | app.add_css_file("theme_overrides.css") |
210 | | - # Fix to https://github.com/sphinx-doc/sphinx/issues/7420 |
211 | | - # from https://github.com/life4/deal/commit/7f33cbc595ed31519cefdfaaf6f415dada5acd94 |
212 | | - # from m2r to make `mdinclude` work |
213 | | - app.add_config_value("no_underscore_emphasis", False, "env") |
214 | | - app.add_config_value("m2r_parse_relative_links", False, "env") |
215 | | - app.add_config_value("m2r_anonymous_references", False, "env") |
216 | | - app.add_config_value("m2r_disable_inline_math", False, "env") |
217 | | - app.add_directive("mdinclude", MdInclude) |
218 | 210 |
|
219 | 211 |
|
220 | 212 | # Add any extra paths that contain custom files (such as robots.txt or |
@@ -374,17 +366,39 @@ def setup(app): |
374 | 366 | "https://github.com/bbfrederick/" "picachooser/blob/{revision}/" "{package}/{path}#L{lineno}", |
375 | 367 | ) |
376 | 368 |
|
377 | | -# Example configuration for intersphinx: refer to the Python standard library. |
| 369 | +# ----------------------------------------------------------------------------- |
| 370 | +# intersphinx |
| 371 | +# ----------------------------------------------------------------------------- |
| 372 | +_python_version_str = f"{sys.version_info.major}.{sys.version_info.minor}" |
| 373 | +_python_doc_base = f"https://docs.python.org/{_python_version_str}" |
378 | 374 | intersphinx_mapping = { |
379 | | - "http://docs.python.org/3.6": None, |
380 | | - "http://docs.scipy.org/doc/numpy": None, |
381 | | - "http://docs.scipy.org/doc/scipy/reference": None, |
382 | | - "http://matplotlib.org/": None, |
383 | | - "http://scikit-learn.org/stable": None, |
384 | | - "http://nipy.org/nibabel/": None, |
385 | | - "http://pandas.pydata.org/pandas-docs/stable/": None, |
| 375 | + "python": (_python_doc_base, None), |
| 376 | + "numpy": ("https://numpy.org/doc/stable/", None), |
| 377 | + "scipy": ( |
| 378 | + "https://docs.scipy.org/doc/scipy/reference", |
| 379 | + (None, "./_intersphinx/scipy-objects.inv"), |
| 380 | + ), |
| 381 | + "matplotlib": ( |
| 382 | + "https://matplotlib.org/stable/", |
| 383 | + (None, "https://matplotlib.org/stable/objects.inv"), |
| 384 | + ), |
| 385 | + "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), |
| 386 | + "nibabel": ("https://nipy.org/nibabel/", None), |
| 387 | + "nilearn": ("http://nilearn.github.io/stable/", None), |
| 388 | + "scikit-learn": ("http://scikit-learn.org/stable", None), |
386 | 389 | } |
387 | 390 |
|
| 391 | +# ----------------------------------------------------------------------------- |
| 392 | +# sphinxcontrib-bibtex |
| 393 | +# ----------------------------------------------------------------------------- |
| 394 | +bibtex_bibfiles = ["references.bib"] |
| 395 | +bibtex_defalut_style = "unsrt" |
| 396 | +bibtex_reference_style = "author_year" |
| 397 | +bibtex_footbibliography_header = "" |
| 398 | + |
| 399 | +# ----------------------------------------------------------------------------- |
| 400 | +# sphinx gallery |
| 401 | +# ----------------------------------------------------------------------------- |
388 | 402 | sphinx_gallery_conf = { |
389 | 403 | # path to your examples scripts |
390 | 404 | "examples_dirs": "../examples", |
|
0 commit comments