-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathconf.py
More file actions
191 lines (149 loc) · 4.42 KB
/
Copy pathconf.py
File metadata and controls
191 lines (149 loc) · 4.42 KB
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
import json
import os
# -------------------------------------------------
# Basic project info
# -------------------------------------------------
version = os.environ.get("WEBSITE_VERSION", "dev")
release = version
language = os.environ.get("WEBSITE_LANGUAGE", "en")
author = "Community"
copyright = "2023"
baseurl = "https://discover-cookbook.numfocus.org"
html_baseurl = baseurl
# -------------------------------------------------
# Paths & exclusions
# -------------------------------------------------
exclude_patterns = [
"**.ipynb_checkpoints",
".DS_Store",
"Thumbs.db",
"_build",
]
locale_dirs = ["../locales"]
gettext_uuid = True
gettext_compact = False
# -------------------------------------------------
# Language switcher context
# -------------------------------------------------
language_json_path = os.path.join(
os.path.dirname(__file__), "_static", "languages.json"
)
language_data = []
current_language_name = language
if os.path.exists(language_json_path):
with open(language_json_path, "r", encoding="utf-8") as f:
all_languages = json.load(f)
current_language_name = next(
(lang["name_local"] for lang in all_languages if lang["code"] == language),
language,
)
language_data = [
lang for lang in all_languages if not lang.get("hidden", False)
]
html_context = {
"languages": language_data,
"current_language_name": current_language_name,
"current_language": language,
"current_version": version,
"baseurl": baseurl,
}
# -------------------------------------------------
# Extensions
# -------------------------------------------------
extensions = [
"sphinx_togglebutton",
"sphinx_copybutton",
"myst_parser",
"jupyter_book",
"sphinx_external_toc",
"sphinx.ext.intersphinx",
"sphinx_design",
"sphinx_book_theme",
"sphinx_tags",
"sphinx_jupyterbook_latex",
"sphinx_multitoc_numbering",
]
# -------------------------------------------------
# External TOC
# -------------------------------------------------
external_toc_path = "_toc.yml"
external_toc_exclude_missing = False
# -------------------------------------------------
# Static files
# -------------------------------------------------
html_static_path = ["_static"]
html_css_files = [
"css/mainLogo.css",
"css/Switchers.css",
]
html_js_files = [
"js/footer.js",
"js/logo-switcher.js",
]
html_logo = "_static/images/logo-light.png"
html_favicon = ""
# -------------------------------------------------
# Templates
# -------------------------------------------------
templates_path = ["_templates"]
# -------------------------------------------------
# Theme
# -------------------------------------------------
html_theme = "sphinx_book_theme"
html_theme_options = {
"search_bar_text": "Search this book...",
"path_to_docs": "DISCOVER",
"repository_url": "https://github.com/numfocus/DISCOVER-Cookbook/",
"repository_branch": "main",
"use_repository_button": True,
"use_edit_page_button": False,
"use_issues_button": True,
# Header layout
"article_header_start": [
"toggle-primary-sidebar",
"version-switcher",
"language-switcher",
],
"navigation_with_keys": False,
"show_version_warning_banner": True,
# Version switcher
"switcher": {
"json_url": "https://discover-cookbook.numfocus.org/versions.json",
"version_match": version,
},
# IMPORTANT:
# Footer MUST be empty here
# It is handled in _templates/footer.html
"extra_footer": "",
}
# -------------------------------------------------
# Page options
# -------------------------------------------------
html_title = "DISCOVER"
html_sourcelink_suffix = ""
# -------------------------------------------------
# MyST & notebooks
# -------------------------------------------------
myst_enable_extensions = [
"colon_fence",
"dollarmath",
"linkify",
"substitution",
"tasklist",
]
myst_url_schemes = ["mailto", "http", "https"]
nb_execution_allow_errors = False
nb_execution_mode = "force"
nb_execution_timeout = 30
nb_output_stderr = "show"
# -------------------------------------------------
# Numbering & tags
# -------------------------------------------------
numfig = True
pygments_style = "sphinx"
suppress_warnings = ["etoc.toctree"]
tags_create_tags = True
tags_extension = ["md"]
use_jupyterbook_latex = True
use_multitoc_numbering = True
latex_engine = "pdflatex"