-
Notifications
You must be signed in to change notification settings - Fork 19
/
conf.py
162 lines (139 loc) · 4.92 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
import sys
from pathlib import Path
HERE = Path(__file__).parent
sys.path.insert(0, str(HERE / "extensions"))
# -- Project information -----------------------------------------------------
# info = metadata("spatialdata-notebooks")
# project = info["Name"]
# author = info["Author"]
# copyright = f"{datetime.now():%Y}, {author}."
# version = info["Version"]
# # The full version, including alpha/beta/rc tags
# release = info["Version"]
project_name = "spatialdata-notebooks"
repository_url = f"https://github.com/scverse/{project_name}"
bibtex_bibfiles = ["references.bib"]
templates_path = ["_templates"]
nitpicky = True # Warn about broken links
needs_sphinx = "4.0"
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "scverse", # Username
"github_repo": project_name, # Repo name
"github_version": "main", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings.
# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"myst_nb",
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinxcontrib.bibtex",
"sphinx_autodoc_typehints",
"sphinx.ext.mathjax",
"IPython.sphinxext.ipython_console_highlighting",
"sphinx_design",
*[p.stem for p in (HERE / "extensions").glob("*.py")],
]
autosummary_generate = True
autodoc_member_order = "groupwise"
default_role = "literal"
napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_use_rtype = True # having a separate entry generally helps readability
napoleon_use_param = True
myst_heading_anchors = 3 # create anchors for h1-h3
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_image",
"html_admonition",
]
myst_url_schemes = ("http", "https", "mailto")
nb_output_stderr = "remove"
nb_execution_mode = "off"
nb_merge_streams = True
typehints_defaults = "braces"
source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
".myst": "myst-nb",
}
intersphinx_mapping = {
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"geopandas": ("https://geopandas.org/en/stable/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
"datatree": ("https://datatree.readthedocs.io/en/latest/", None),
}
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
# note: these patterns should also be added in spatialdata/docs/conf.py
exclude_patterns = [
"_build",
"Thumbs.db",
"**.ipynb_checkpoints",
"data",
"temp",
"notebooks/paper_reproducibility",
"notebooks/examples/*.zarr",
"Readme.md", # hack cause git his acting up
"notebooks/developers_resources/storage_format/*.ipynb",
"notebooks/developers_resources/storage_format/Readme.md",
"notebooks/examples/technology_stereoseq.ipynb", # no public data available
"notebooks/examples/technology_curio.ipynb", # no public data available
"notebooks/examples/stereoseq_data/*",
]
# Ignore warnings.
nitpicky = False # TODO: solve upstream.
# nitpick_ignore = [
# ("py:class", "spatial_image.SpatialImage"),
# ("py:class", "multiscale_spatial_image.multiscale_spatial_image.MultiscaleSpatialImage"),
# ]
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]
html_title = project_name
html_theme_options = {
"repository_url": repository_url,
"use_repository_button": True,
"navigation_with_keys": True,
}
pygments_style = "default"
nitpick_ignore = [
# If building the documentation fails because of a missing link that is outside your control,
# you can add an exception to this list.
# ("py:class", "igraph.Graph"),
]
def setup(app):
"""App setup hook."""
app.add_config_value(
"recommonmark_config",
{
"auto_toc_tree_section": "Contents",
"enable_auto_toc_tree": True,
"enable_math": True,
"enable_inline_math": False,
"enable_eval_rst": True,
},
True,
)