1# Configuration file for the Sphinx documentation builder.
2#
3# This file only contains a selection of the most common options. For a full
4# list see the documentation:
5# http://www.sphinx-doc.org/en/master/config
6# -- Path setup --------------------------------------------------------------
7# If extensions (or modules to document with autodoc) are in another directory,
8# add these directories to sys.path here. If the directory is relative to the
9# documentation root, use os.path.abspath to make it absolute, like shown here.
10#
11# import os
12# import sys
13# sys.path.insert(0, os.path.abspath('.'))
14import platform
15from datetime import datetime
16from zoneinfo import ZoneInfo
17
18import sphinx
19import sphinx_material
20
21# If extensions (or modules to document with autodoc) are in another directory,
22# add these directories to sys.path here. If the directory is relative to the
23# documentation root, use os.path.abspath to make it absolute, like shown here.
24# sys.path.insert(0, os.path.abspath("./src"))
25
26
27project = "Tuto HTML"
28html_title = project
29
30author = f"DevOps people"
31html_logo = "images/html_living.png"
32html_favicon = "images/html_living.png"
33release = "0.1.0"
34now = datetime.now(tz=ZoneInfo("Europe/Paris"))
35version = f"{now.year}-{now.month:02}-{now.day:02} {now.hour:02}H ({now.tzinfo})"
36today = version
37
38extensions = [
39 "sphinx.ext.autodoc",
40 "sphinx.ext.doctest",
41 "sphinx.ext.extlinks",
42 "sphinx.ext.intersphinx",
43 "sphinx.ext.todo",
44 "sphinx.ext.mathjax",
45 "sphinx.ext.viewcode",
46 "myst_parser",
47 "sphinx_markdown_tables",
48 "sphinx_copybutton",
49]
50autosummary_generate = True
51autoclass_content = "class"
52
53# Add any paths that contain templates here, relative to this directory.
54templates_path = ["_templates"]
55exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
56html_static_path = ["_static"]
57html_show_sourcelink = True
58html_sidebars = {
59 "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
60}
61extensions.append("sphinx_material")
62html_theme_path = sphinx_material.html_theme_path()
63html_context = sphinx_material.get_html_context()
64html_theme = "sphinx_material"
65
66extensions.append("sphinx.ext.intersphinx")
67intersphinx_mapping = {
68 "docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
69 "tuto_javascript": ("https://gdevops.gitlab.io/tuto_javascript/", None),
70 "django": ("https://gdevops.gitlab.io/tuto_django/", None),
71 "documentation": ("https://gdevops.gitlab.io/tuto_documentation/", None),
72 "http": ("https://gdevops.gitlab.io/tuto_http/", None),
73 "webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
74 "project": ("https://gdevops.gitlab.io/tuto_project/", None),
75 "webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
76 "conda": ("https://conda.io/en/latest/", None),
77 "sphinx": ("https://www.sphinx-doc.org/en/master", None),
78 "sphinx_material": ("https://gdevops.gitlab.io/tuto_sphinx_material", None),
79}
80extensions.append("sphinx.ext.todo")
81todo_include_todos = True
82
83extensions += [
84 "sphinx_panels",
85]
86extensions += ["sphinx_tabs.tabs"]
87# Panels config
88panels_add_bootstrap_css = False
89
90# autoclasstoc + napoleon + autodoc
91# https://autoclasstoc.readthedocs.io/en/latest/basic_usage.html
92extensions += [
93 "autoclasstoc",
94 "sphinx.ext.napoleon",
95 "sphinx.ext.autodoc",
96 "sphinx.ext.autosummary",
97 "sphinx.ext.viewcode",
98]
99autodoc_default_options = {
100 "members": True,
101 "special-members": True,
102 "private-members": True,
103 "inherited-members": True,
104 "undoc-members": True,
105 "exclude-members": "__weakref__",
106}
107
108# material theme options (see theme.conf for more information)
109# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
110# Colors
111# The theme color for mobile browsers. Hex color.
112# theme_color = #3f51b5
113# Primary colors:
114# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
115# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
116# brown, grey, blue-grey, white
117# Accent colors:
118# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
119# teal, green, light-green, lime, yellow, amber, orange, deep-orange
120# color_accent = blue
121# color_primary = blue-grey
122
123# material theme options (see theme.conf for more information)
124html_theme_options = {
125 "base_url": "https://gdevops.gitlab.io/tuto_html/",
126 "repo_url": "https://gitlab.com/gdevops/tuto_html",
127 "repo_name": project,
128 "html_minify": False,
129 "html_prettify": True,
130 "css_minify": True,
131 "repo_type": "gitlab",
132 "globaltoc_depth": -1,
133 "color_primary": "green",
134 "color_accent": "cyan",
135 "theme_color": "#2196f3",
136 "nav_title": f"{project} ({today})",
137 "master_doc": False,
138 "nav_links": [
139 {
140 "href": "genindex",
141 "internal": True,
142 "title": "Index",
143 },
144 {
145 "href": "https://html.spec.whatwg.org/",
146 "internal": False,
147 "title": "HTML Living Standard",
148 },
149 {
150 "href": "https://developer.mozilla.org/en-US/docs/Web/HTML",
151 "internal": False,
152 "title": "Mozilla HTML (MDN)",
153 },
154 {
155 "href": "https://en.wikipedia.org/wiki/HTML5",
156 "internal": False,
157 "title": "Wikipedia HTML5",
158 },
159 {
160 "href": "https://gdevops.gitlab.io/tuto_htmx/",
161 "internal": False,
162 "title": "htmx",
163 },
164 {
165 "href": "https://gdevops.gitlab.io/tuto_devops/",
166 "internal": False,
167 "title": "Tuto devops",
168 },
169 ],
170 "heroes": {
171 "index": "Tuto HTML",
172 },
173 "table_classes": ["plain"],
174}
175
176
177language = "en"
178html_last_updated_fmt = ""
179
180todo_include_todos = True
181
182html_use_index = True
183html_domain_indices = True
184
185copyright = f"2018-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"