|
5 | 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
6 | 6 |
|
7 | 7 | # -- Path setup -------------------------------------------------------------- |
| 8 | +import shutil |
8 | 9 | import sys |
9 | 10 | from datetime import datetime |
10 | 11 | from importlib.metadata import metadata |
11 | 12 | from pathlib import Path |
12 | 13 |
|
| 14 | +from sphinxcontrib import katex |
| 15 | + |
13 | 16 | HERE = Path(__file__).parent |
14 | 17 | sys.path.insert(0, str(HERE / "extensions")) |
15 | 18 |
|
|
19 | 22 | # NOTE: If you installed your project in editable mode, this might be stale. |
20 | 23 | # If this is the case, reinstall it to refresh the metadata |
21 | 24 | info = metadata("decoupler") |
22 | | -project_name = info["Name"] |
| 25 | +project = info["Name"] |
23 | 26 | author = info["Author"] |
24 | 27 | copyright = f"{datetime.now():%Y}, scverse." |
25 | 28 | version = info["Version"] |
|
37 | 40 | html_context = { |
38 | 41 | "display_github": True, # Integrate GitHub |
39 | 42 | "github_user": "scverse", |
40 | | - "github_repo": project_name, |
| 43 | + "github_repo": project, |
41 | 44 | "github_version": "main", |
42 | 45 | "conf_py_path": "/docs/", |
43 | 46 | } |
|
54 | 57 | "sphinx.ext.autosummary", |
55 | 58 | "sphinx.ext.napoleon", |
56 | 59 | "sphinxcontrib.bibtex", |
| 60 | + "sphinxcontrib.katex", |
57 | 61 | "sphinx_autodoc_typehints", |
58 | 62 | "sphinx_tabs.tabs", |
59 | | - "sphinx.ext.mathjax", |
60 | 63 | "IPython.sphinxext.ipython_console_highlighting", |
61 | 64 | "sphinxext.opengraph", |
62 | 65 | *[p.stem for p in (HERE / "extensions").glob("*.py")], |
|
92 | 95 | } |
93 | 96 |
|
94 | 97 | intersphinx_mapping = { |
95 | | - "python": ("https://docs.python.org/3", None), |
| 98 | + # TODO: replace `3.13` with `3` once ReadTheDocs supports building with Python 3.14 |
| 99 | + "python": ("https://docs.python.org/3.13", None), |
96 | 100 | "anndata": ("https://anndata.readthedocs.io/en/stable/", None), |
97 | 101 | "scanpy": ("https://scanpy.readthedocs.io/en/stable/", None), |
98 | 102 | "numpy": ("https://numpy.org/doc/stable/", None), |
|
115 | 119 | html_static_path = ["_static"] |
116 | 120 | html_css_files = ["css/custom.css"] |
117 | 121 |
|
118 | | -html_title = project_name |
| 122 | +html_title = project |
119 | 123 | html_logo = "_static/images/logo.png" |
120 | 124 | html_favicon = "_static/images/logo.png" |
121 | 125 |
|
|
127 | 131 | } |
128 | 132 |
|
129 | 133 | pygments_style = "default" |
| 134 | +katex_prerender = shutil.which(katex.NODEJS_BINARY) is not None |
130 | 135 |
|
131 | 136 | nitpick_ignore = [ |
132 | 137 | # If building the documentation fails because of a missing link that is outside your control, |
|
0 commit comments