|
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("cellcharter") |
22 | | -project_name = info["Name"] |
| 25 | +project = info["Name"] |
23 | 26 | author = info["Author"] |
24 | 27 | copyright = f"{datetime.now():%Y}, {author}." |
25 | 28 | version = info["Version"] |
|
37 | 40 | html_context = { |
38 | 41 | "display_github": True, # Integrate GitHub |
39 | 42 | "github_user": "marcovarrone", |
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), |
|
113 | 117 | html_static_path = ["_static"] |
114 | 118 | html_css_files = ["css/custom.css"] |
115 | 119 |
|
116 | | -html_title = project_name |
| 120 | +html_title = project |
117 | 121 |
|
118 | 122 | html_theme_options = { |
119 | 123 | "repository_url": repository_url, |
|
123 | 127 | } |
124 | 128 |
|
125 | 129 | pygments_style = "default" |
| 130 | +katex_prerender = shutil.which(katex.NODEJS_BINARY) is not None |
126 | 131 |
|
127 | 132 | nitpick_ignore = [ |
128 | 133 | # If building the documentation fails because of a missing link that is outside your control, |
|
0 commit comments