-
Notifications
You must be signed in to change notification settings - Fork 28
/
conf.py
219 lines (188 loc) · 6.36 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# 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:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# add docs path to python sys.path to allow autodoc-ing a test_py_module
import os
import sys
sys.path.insert(0, os.path.abspath("."))
# -- Project information -----------------------------------------------------
project = "Sphinx-Immaterial"
copyright = "2021 The Sphinx-Immaterial Authors"
author = "Jeremy Maitin-Shepard"
# The full version, including alpha/beta/rc tags
release = "1"
# -- 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 = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinxcontrib.details.directive",
"sphinx_immaterial.theme_result",
"sphinx_immaterial.kbd_keys",
"sphinx_immaterial.format_signatures",
"sphinx_immaterial.cppreference",
]
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"sphinx_docs": ("https://www.sphinx-doc.org/en/master", None),
}
# The reST default role (used for this markup: `text`) to use for all
# documents.
default_role = "any"
autosummary_generate = True
autoclass_content = "class"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# 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.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# -- sphinx_immaterial.keys extension options
#
# optional key_map for example purposes
keys_map = {"my-special-key": "Awesome Key", "git": ""}
# -- Options for HTML output -------------------------------------------------
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named 'default.css' will overwrite the builtin 'default.css'.
html_static_path = ["_static"]
html_css_files = ["extra_css.css"]
html_last_updated_fmt = ""
html_title = "Sphinx-Immaterial"
html_favicon = "_static/images/favicon.ico" # colored version of material/bookshelf.svg
html_logo = "_static/images/Ybin.gif" # from https://gifer.com/en/Ybin
# -- HTML theme specific settings ------------------------------------------------
extensions.append("sphinx_immaterial")
html_theme = "sphinx_immaterial"
# material theme options (see theme.conf for more information)
html_theme_options = {
"icon": {
"repo": "fontawesome/brands/github",
},
"site_url": "https://jbms.github.io/sphinx-immaterial/",
"repo_url": "https://github.com/jbms/sphinx-immaterial/",
"repo_name": "Sphinx-Immaterial",
"repo_type": "github",
"edit_uri": "blob/main/docs",
# "google_analytics": ["UA-XXXXX", "auto"],
"globaltoc_collapse": True,
"features": [
# "navigation.expand",
# "navigation.tabs",
# "toc.integrate",
"navigation.sections",
# "navigation.instant",
# "header.autohide",
"navigation.top",
# "navigation.tracking",
# "search.highlight",
"search.share",
],
"palette": [
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "light-green",
"accent": "light-blue",
"toggle": {
"icon": "material/lightbulb-outline",
"name": "Switch to dark mode",
},
},
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "deep-orange",
"accent": "lime",
"toggle": {
"icon": "material/lightbulb",
"name": "Switch to light mode",
},
},
],
# BEGIN: version_dropdown
"version_dropdown": True,
"version_info": [
{
"version": "https://sphinx-immaterial.rtfd.io",
"title": "ReadTheDocs",
"aliases": [],
},
{
"version": "https://jbms.github.io/sphinx-immaterial",
"title": "Github Pages",
"aliases": [],
},
],
# END: version_dropdown
"toc_title_is_page_title": True,
}
# end html_theme_options
# ---- Other documentation options -------------------------
todo_include_todos = True
extlinks = {
"duref": (
"http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s",
"",
),
"durole": ("http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s", ""),
"dudir": ("http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s", ""),
}
# BEGIN: sphinx_immaterial.format_signatures extension options
clang_format_signatures_domain_styles = {
"cpp": """{
BasedOnStyle: LLVM,
ColumnLimit: 68,
}""",
}
# END: sphinx_immaterial.format_signatures extension options
html_wrap_signatures_with_css = ["py"]
# BEGIN: sphinx_immaterial.external_cpp_references extension options
external_cpp_references = {
"nlohmann::json": {
"url": "https://json.nlohmann.me/api/json/",
"object_type": "type alias",
"desc": "C++ type alias",
},
"nlohmann::basic_json": {
"url": "https://json.nlohmann.me/api/basic_json/",
"object_type": "class",
"desc": "C++ class",
},
}
# END: sphinx_immaterial.external_cpp_references extension options
# BEGIN: cpp_strip_namespaces_from_signatures option
cpp_strip_namespaces_from_signatures = [
"my_ns1",
"my_ns2",
"my_ns2::my_nested_ns",
]
# END: cpp_strip_namespaces_from_signatures option
rst_prolog = """
.. role:: python(code)
:language: python
:class: highlight
.. role:: cpp(code)
:language: cpp
:class: highlight
.. role:: json(code)
:language: json
:class: highlight
"""
def setup(app):
app.add_object_type(
"confval",
"confval",
objname="configuration value",
indextemplate="pair: %s; configuration value",
)