-
Notifications
You must be signed in to change notification settings - Fork 92
/
conf.py
167 lines (140 loc) · 5.2 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
# 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 --------------------------------------------------------------
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from distutils.version import LooseVersion
import sphinx_material
FORCE_CLASSIC = os.environ.get("SPHINX_MATERIAL_FORCE_CLASSIC", False)
FORCE_CLASSIC = FORCE_CLASSIC in ("1", "true")
# -- Project information -----------------------------------------------------
project = "Material for Sphinx"
html_title = "Material for Sphinx"
copyright = "2019, Kevin Sheppard"
author = "Kevin Sheppard"
# The full version, including alpha/beta/rc tags
release = LooseVersion(sphinx_material.__version__).vstring
# -- 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",
"numpydoc",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"nbsphinx",
"sphinx_markdown_tables",
"sphinx_copybutton",
"sphinx_search.extension",
"myst_parser",
]
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"]
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# 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 theme settings ------------------------------------------------
html_show_sourcelink = True
html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}
extensions.append("sphinx_material")
html_theme_path = sphinx_material.html_theme_path()
html_context = sphinx_material.get_html_context()
html_theme = "sphinx_material"
# material theme options (see theme.conf for more information)
html_theme_options = {
"base_url": "http://bashtage.github.io/sphinx-material/",
"repo_url": "https://github.com/bashtage/sphinx-material/",
"repo_name": "Material for Sphinx",
"google_analytics_account": "UA-XXXXX",
"html_minify": False,
"html_prettify": True,
"css_minify": True,
"logo_icon": "",
"repo_type": "github",
"globaltoc_depth": 2,
"color_primary": "blue",
"color_accent": "cyan",
"touch_icon": "images/apple-icon-152x152.png",
"theme_color": "#2196f3",
"master_doc": False,
"nav_links": [
{"href": "index", "internal": True, "title": "Material"},
{
"href": "https://squidfunk.github.io/mkdocs-material/",
"internal": False,
"title": "Material for MkDocs",
},
],
"heroes": {
"index": "A responsive Material Design theme for Sphinx sites.",
"customization": "Configuration options to personalize your site.",
},
"version_dropdown": True,
"version_json": "_static/versions.json",
"version_info": {
"Release": "https://bashtage.github.io/sphinx-material/",
"Development": "https://bashtage.github.io/sphinx-material/devel/",
"Release (rel)": "/sphinx-material/",
"Development (rel)": "/sphinx-material/devel/",
},
"table_classes": ["plain"],
}
if FORCE_CLASSIC:
print("!!!!!!!!! Forcing classic !!!!!!!!!!!")
html_theme = "classic"
html_theme_options = {}
html_sidebars = {"**": ["globaltoc.html", "localtoc.html", "searchbox.html"]}
language = "en"
html_last_updated_fmt = ""
todo_include_todos = True
html_favicon = "images/favicon.ico"
html_use_index = True
html_domain_indices = True
nbsphinx_execute = "always"
nbsphinx_kernel_name = "python3"
extlinks = {
"duref": (
"http://docutils.sourceforge.net/docs/ref/rst/" "restructuredtext.html#%s",
None,
),
"durole": ("http://docutils.sourceforge.net/docs/ref/rst/" "roles.html#%s", None),
"dudir": (
"http://docutils.sourceforge.net/docs/ref/rst/" "directives.html#%s",
None,
),
}
# Enable eval_rst in markdown
def setup(app):
app.add_object_type(
"confval",
"confval",
objname="configuration value",
indextemplate="pair: %s; configuration value",
)