Skip to content

Commit 21b9e9d

Browse files
committed
Update conf.py
1 parent 58d447e commit 21b9e9d

File tree

1 file changed

+41
-27
lines changed

1 file changed

+41
-27
lines changed

docs/conf.py

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# picachooser documentation build configuration file,
5-
# copied from rapidtide
4+
# picachooser documentation build configuration file, copied from
5+
# capcalc 8/21/2025
66
#
77
# This file is execfile()d with the current directory set to its
88
# containing dir.
@@ -17,8 +17,6 @@
1717
import sys
1818
from datetime import datetime
1919

20-
from m2r import MdInclude
21-
2220
# If extensions (or modules to document with autodoc) are in another directory,
2321
# add these directories to sys.path here. If the directory is relative to the
2422
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -46,6 +44,7 @@
4644

4745
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
4846

47+
4948
from github_link import make_linkcode_resolve
5049

5150
import picachooser
@@ -66,18 +65,20 @@
6665
# ones.
6766
extensions = [
6867
"sphinx.ext.todo",
68+
"sphinx.ext.autosectionlabel",
6969
"sphinx.ext.coverage",
7070
"sphinx.ext.autodoc",
7171
"sphinx.ext.napoleon",
7272
"sphinxarg.ext",
7373
"sphinx.ext.intersphinx",
7474
"sphinx.ext.autosummary",
7575
"sphinx.ext.doctest",
76+
"myst_parser",
7677
"numpydoc",
7778
"sphinx.ext.ifconfig",
7879
"sphinx.ext.linkcode",
79-
"recommonmark",
8080
"sphinx_gallery.gen_gallery",
81+
"sphinxcontrib.bibtex",
8182
]
8283

8384
from distutils.version import LooseVersion
@@ -94,8 +95,7 @@
9495

9596
# The suffix(es) of source filenames.
9697
# You can specify multiple suffix as a list of string:
97-
# source_suffix = ['.rst', '.md']
98-
source_suffix = ".rst"
98+
source_suffix = [".rst"]
9999

100100
# The encoding of source files.
101101
# source_encoding = 'utf-8-sig'
@@ -105,17 +105,17 @@
105105

106106
# General information about the project.
107107
project = "picachooser"
108-
copyright = "2020-" + datetime.today().strftime("%Y") + ", Blaise Frederick"
108+
copyright = "2019-" + datetime.today().strftime("%Y") + ", Blaise Frederick"
109109
author = "Blaise Frederick"
110110

111111
# The version info for the project you're documenting, acts as replacement for
112112
# |version| and |release|, also used in various other places throughout the
113113
# built documents.
114114
#
115115
# The short X.Y version.
116-
import picachooser.util as pica_util
116+
import picachooser.util as tide_util
117117

118-
version = pica_util.version()[0].replace("v", "").split("+")[0]
118+
version = tide_util.version()[0].replace("v", "").split("+")[0]
119119
# The full version, including alpha/beta/rc tags.
120120
release = version
121121

@@ -124,7 +124,7 @@
124124
#
125125
# This is also used if you do content translation via gettext catalogs.
126126
# Usually you set "language" from the command line for these cases.
127-
language = None
127+
language = "en"
128128

129129
# There are two options for replacing |today|: either, you set today to some
130130
# non-false value, then it is used:
@@ -207,14 +207,6 @@
207207
# https://github.com/rtfd/sphinx_rtd_theme/issues/117
208208
def setup(app):
209209
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)
218210

219211

220212
# Add any extra paths that contain custom files (such as robots.txt or
@@ -374,17 +366,39 @@ def setup(app):
374366
"https://github.com/bbfrederick/" "picachooser/blob/{revision}/" "{package}/{path}#L{lineno}",
375367
)
376368

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}"
378374
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),
386389
}
387390

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+
# -----------------------------------------------------------------------------
388402
sphinx_gallery_conf = {
389403
# path to your examples scripts
390404
"examples_dirs": "../examples",

0 commit comments

Comments
 (0)