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 htmx"
28html_title = project
29
30author = f"DevOps people"
31html_logo = "images/logo/white_blackbg.png"
32html_favicon = "images/logo/white_blackbg.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_copybutton",
48]
49autosummary_generate = True
50autoclass_content = "class"
51
52# Add any paths that contain templates here, relative to this directory.
53templates_path = ["_templates"]
54exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "github"]
55html_static_path = ["_static"]
56html_show_sourcelink = True
57html_sidebars = {
58 "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
59}
60extensions.append("sphinx_material")
61html_theme_path = sphinx_material.html_theme_path()
62html_context = sphinx_material.get_html_context()
63html_theme = "sphinx_material"
64
65extensions.append("sphinx.ext.intersphinx")
66intersphinx_mapping = {
67 "docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
68 "tuto_django": ("https://gdevops.gitlab.io/tuto_django/", None),
69 "tuto_hyperscript": ("https://gdevops.gitlab.io/tuto_hyperscript/", None),
70 "tuto_html": ("https://gdevops.gitlab.io/tuto_html/", None),
71 "documentation": ("https://gdevops.gitlab.io/tuto_documentation/", None),
72 "http": ("https://gdevops.gitlab.io/tuto_http/", None),
73 "tuto_webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
74 "project": ("https://gdevops.gitlab.io/tuto_project/", None),
75 "sphinx": ("https://www.sphinx-doc.org/en/master", None),
76 "sphinx_material": ("https://gdevops.gitlab.io/tuto_sphinx_material", None),
77 "til_2021": ("https://gdevops.gitlab.io/til_2021/", None),
78}
79extensions.append("sphinx.ext.todo")
80todo_include_todos = True
81
82extensions += [
83 "sphinx_panels",
84]
85extensions += ["sphinx_tabs.tabs"]
86# Panels config
87panels_add_bootstrap_css = False
88
89# autoclasstoc + napoleon + autodoc
90# https://autoclasstoc.readthedocs.io/en/latest/basic_usage.html
91extensions += [
92 "autoclasstoc",
93 "sphinx.ext.napoleon",
94 "sphinx.ext.autodoc",
95 "sphinx.ext.autosummary",
96 "sphinx.ext.viewcode",
97]
98autodoc_default_options = {
99 "members": True,
100 "special-members": True,
101 "private-members": True,
102 "inherited-members": True,
103 "undoc-members": True,
104 "exclude-members": "__weakref__",
105}
106
107# material theme options (see theme.conf for more information)
108# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
109# Colors
110# The theme color for mobile browsers. Hex color.
111# theme_color = #3f51b5
112# Primary colors:
113# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
114# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
115# brown, grey, blue-grey, white
116# Accent colors:
117# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
118# teal, green, light-green, lime, yellow, amber, orange, deep-orange
119# color_accent = blue
120# color_primary = blue-grey
121
122# material theme options (see theme.conf for more information)
123html_theme_options = {
124 "base_url": "https://gdevops.gitlab.io/tuto_htmx/",
125 "repo_url": "https://gitlab.com/gdevops/tuto_htmx",
126 "repo_name": project,
127 "html_minify": False,
128 "html_prettify": True,
129 "css_minify": True,
130 "repo_type": "gitlab",
131 "globaltoc_depth": -1,
132 "color_primary": "green",
133 "color_accent": "cyan",
134 "theme_color": "#2196f3",
135 "nav_title": f"{project} ({today})",
136 "master_doc": False,
137 "nav_links": [
138 {
139 "href": "genindex",
140 "internal": True,
141 "title": "Index",
142 },
143 {
144 "href": "https://htmx.org/",
145 "internal": False,
146 "title": "htmx",
147 },
148 {
149 "href": "https://gdevops.gitlab.io/tuto_html/",
150 "internal": False,
151 "title": "Tuto HTML",
152 },
153 {
154 "href": "https://gdevops.gitlab.io/tuto_hyperscript/",
155 "internal": False,
156 "title": "Tuto hyperscript",
157 },
158 {
159 "href": "https://gdevops.gitlab.io/tuto_django/",
160 "internal": False,
161 "title": "Tuto Django",
162 },
163 ],
164 "heroes": {
165 "index": "Tuto htmx",
166 },
167 "table_classes": ["plain"],
168}
169
170
171language = "en"
172html_last_updated_fmt = ""
173
174todo_include_todos = True
175
176html_use_index = True
177html_domain_indices = True
178
179copyright = f"2021-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"
180
181rst_prolog = """
182.. |thisweek| image:: /images/thisweek_favicon.svg
183"""