forked from plone/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.py
More file actions
334 lines (274 loc) · 11.8 KB
/
conf.py
File metadata and controls
334 lines (274 loc) · 11.8 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
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# Configuration file for the Sphinx documentation builder.
# Plone Documentation build configuration file
# -- Path setup --------------------------------------------------------------
from datetime import datetime
# 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("."))
# -- Project information -----------------------------------------------------
project = "Plone Documentation"
copyright = "Plone Foundation"
author = "the Plone community"
trademark_name = "Plone"
now = datetime.now()
year = str(now.year)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "6.0"
# The full version, including alpha/beta/rc tags.
release = "6.0"
# -- General configuration ----------------------------------------------------
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# 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_parser",
"sphinx.ext.autodoc",
"sphinx.ext.ifconfig",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx_copybutton",
"sphinx_design",
"sphinx_sitemap",
"sphinxcontrib.httpdomain", # plone.restapi
"sphinxcontrib.httpexample", # plone.restapi
"sphinxcontrib.video",
"sphinxext.opengraph",
"sphinx.ext.viewcode", # plone.api
"sphinx.ext.autosummary", # plone.api
"sphinx.ext.graphviz",
"notfound.extension",
]
# If true, the Docutils Smart Quotes transform, originally based on SmartyPants
# (limited to English) and currently applying to many languages, will be used
# to convert quotes and dashes to typographically correct entities.
# Note to maintainers: setting this to `True` will cause contractions and
# hyphenated words to be marked as misspelled by spellchecker.
smartquotes = False
# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = "sphinx.pygments_styles.PyramidStyle"
pygments_style = "sphinx"
# Options for the linkcheck builder
# Ignore localhost
linkcheck_ignore = [
# Ignore local and example URLs
r"http://0.0.0.0",
r"http://127.0.0.1",
r"http://localhost",
r"http://yoursite",
# Ignore file downloads
r"^/_static/",
# Ignore pages that require authentication
r"https://github.com/orgs/plone/teams/", # requires auth
r"https://github.com/plone/documentation/issues/new/choose", # requires auth
r"https://github.com/plone/volto/issues/new/choose", # requires auth
# Ignore github.com pages with anchors
r"https://github.com/.*#.*",
# Ignore other specific anchors
r"https://coveralls.io/repos/github/plone/plone.restapi/badge.svg\?branch=main", # plone.restapi
r"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors#Identifying_the_issue",
r"https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-version-10-0", # volto
# Ignore unreliable sites
r"https://web.archive.org/", # volto
r"https://www.youtube.com/playlist", # volto, TODO remove after installing sphinxcontrib.youtube
]
linkcheck_anchors = True
linkcheck_timeout = 5
linkcheck_retries = 1
# The suffix of source filenames.
source_suffix = {
".md": "markdown",
".rst": "restructuredtext",
}
# The master toctree document.
master_doc = "index"
# 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 = [
"spelling_wordlist.txt",
"**/CHANGES.rst",
"**/CONTRIBUTORS.rst",
"**/LICENSE.rst",
"**/README.rst",
"plone.restapi/.*",
"plone.restapi/bin",
"plone.restapi/docs/source/glossary.md", # There can be only one Glossary.
"plone.restapi/ideas",
"plone.restapi/include",
"plone.restapi/lib",
"plone.restapi/news",
"plone.restapi/performance",
"plone.restapi/src",
"volto/contributing/branch-policy.md",
]
suppress_warnings = [
# "toc.excluded", # Suppress `WARNING: document isn't included in any toctree`
"toc.not_readable", # Suppress `WARNING: toctree contains reference to nonexisting document 'news*'`
]
html_js_files = ["patch_scrollToActive.js", "search_shortcut.js"]
html_extra_path = [
"robots.txt",
]
html_static_path = [
"volto/_static",
"_static", # Last path wins. See https://github.com/plone/documentation/pull/1442
]
# -- Options for myST markdown conversion to html -----------------------------
# For more information see:
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
myst_enable_extensions = [
"deflist", # Support definition lists.
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists
"linkify", # Identify "bare" web URLs and add hyperlinks.
"colon_fence", # You can also use ::: delimiters to denote code fences,\
# instead of ```.
"substitution", # plone.restapi \
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images
]
myst_substitutions = {
"postman_basic_auth": "",
"postman_headers": "",
"postman_request": "",
"postman_response": "",
"postman_retain_headers": "",
"fawrench": '<span class="fa fa-wrench" style="font-size: 1.6em;"></span>',
}
# -- Intersphinx configuration ----------------------------------
# This extension can generate automatic links to the documentation of objects
# in other projects. Usage is simple: whenever Sphinx encounters a
# cross-reference that has no matching target in the current documentation set,
# it looks for targets in the documentation sets configured in
# intersphinx_mapping. A reference like :py:class:`zipfile.ZipFile` can then
# linkto the Python documentation for the ZipFile class, without you having to
# specify where it is located exactly.
#
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html
#
# Note that Plone Documentation imports documentation from several remote repositories.
# These projects need to build their docs as part of their CI/CD and testing.
# We use Intersphinx to resolve targets when either the individual project's or
# the entire Plone Documentation is built.
intersphinx_mapping = {
"plone": ("https://6.docs.plone.org/", None), # for imported packages
"python": ("https://docs.python.org/3/", None),
"training": ("https://training.plone.org/", None),
"training-2022": ("https://2022.training.plone.org/", None),
}
# -- GraphViz configuration ----------------------------------
graphviz_output_format = "svg"
# -- OpenGraph configuration ----------------------------------
ogp_site_url = "https://6.docs.plone.org/"
ogp_description_length = 200
ogp_image = "https://6.docs.plone.org/_static/Plone_logo_square.png"
ogp_site_name = "Plone Documentation"
ogp_type = "website"
ogp_custom_meta_tags = [
'<meta property="og:locale" content="en_US" />',
]
# -- sphinx-notfound-page configuration ----------------------------------
notfound_urls_prefix = ""
notfound_template = "404.html"
# -- 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_logo = "_static/logo.svg"
html_favicon = "_static/favicon.ico"
html_css_files = ["custom.css", ("print.css", {"media": "print"})]
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos
todo_include_todos = True
# Announce that we have an opensearch plugin
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch
html_use_opensearch = "https://6.docs.plone.org"
html_sidebars = {
"**": [
"sidebar-logo.html",
"search-field.html",
"sbt-sidebar-nav.html",
]
}
html_theme_options = {
"path_to_docs": "docs",
"repository_url": "https://github.com/plone/documentation",
"repository_branch": "main",
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
"search_bar_text": "Search",
"switcher": {
"json_url": "/_static/switcher.json",
"version_match": version,
},
"extra_navbar": """
<p class="ploneorglink">
<a href="https://plone.org">
<img src="/_static/logo.svg" alt="plone.org" /> plone.org</a>
</p>""",
"extra_footer": """<p>The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license. Plone and the Plone® logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see <a href="https://plone.org/foundation/logo">https://plone.org/foundation/logo</a>. All other trademarks are owned by their respective owners.</p>
<p><a href="https://www.netlify.com">
<img src="https://www.netlify.com/img/global/badges/netlify-color-bg.svg" alt="Deploys by Netlify" />
</a></p>""",
}
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = "%(project)s v%(release)s" % {"project": project, "release": release}
# If false, no index is generated.
html_use_index = True
# Used by sphinx_sitemap to generate a sitemap
html_baseurl = "https://6.docs.plone.org/"
# https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html#customizing-the-url-scheme
sitemap_url_scheme = "{link}"
# -- Options for HTML help output -------------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = "PloneDocumentation"
# -- Options for LaTeX output -------------------------------------------------
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual])
latex_documents = [
(
"index",
"PloneDocumentation.tex",
"Plone Documentation",
"The Plone community",
"manual",
),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "_static/logo_2x.png"
# suggest edit link
# remark: {{ file_name }} is mandatory in "edit_page_url_template"
html_context = {
"edit_page_url_template": "https://6.docs.plone.org/contributing/index.html?{{ file_name }}#making-contributions-on-github",
}
# An extension that allows replacements for code blocks that
# are not supported in `rst_epilog` or other substitutions.
# https://stackoverflow.com/a/56328457/2214933
def source_replace(app, docname, source):
result = source[0]
for key in app.config.source_replacements:
result = result.replace(key, app.config.source_replacements[key])
source[0] = result
# Dict of replacements.
source_replacements = {
"{PLONE_BACKEND_MINOR_VERSION}": "6.0",
"{PLONE_BACKEND_PATCH_VERSION}": "6.0.8",
"{NVM_VERSION}": "0.39.5",
"{SUPPORTED_PYTHON_VERSIONS}": "3.8, 3.9, 3.10, or 3.11",
}
def setup(app):
app.add_config_value("source_replacements", {}, True)
app.connect("source-read", source_replace)
app.add_config_value("context", "documentation", "env")