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
26project = "Tuto project"
27html_title = project
28
29author = f"DevOps people"
30html_logo = "images/project.png"
31html_favicon = "images/project.png"
32release = "0.1.0"
33now = datetime.now(tz=ZoneInfo("Europe/Paris"))
34version = f"{now.year}-{now.month:02}-{now.day:02} {now.hour:02}H ({now.tzinfo})"
35today = version
36
37extensions = [
38 "sphinx.ext.autodoc",
39 "sphinx.ext.doctest",
40 "sphinx.ext.extlinks",
41 "sphinx.ext.intersphinx",
42 "sphinx.ext.todo",
43 "sphinx.ext.mathjax",
44 "sphinx.ext.viewcode",
45 "sphinx_copybutton",
46]
47autosummary_generate = True
48autoclass_content = "class"
49
50# Add any paths that contain templates here, relative to this directory.
51templates_path = ["_templates"]
52exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
53html_static_path = ["_static"]
54html_show_sourcelink = True
55html_sidebars = {
56 "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
57}
58extensions.append("sphinx_material")
59html_theme_path = sphinx_material.html_theme_path()
60html_context = sphinx_material.get_html_context()
61html_theme = "sphinx_material"
62
63extensions.append("sphinx.ext.intersphinx")
64intersphinx_mapping = {
65 "tuto_python": ("https://gdevops.gitlab.io/python/tuto/", None),
66 "tuto_kubernetes": ("https://gdevops.gitlab.io/tuto_kubernetes/", None),
67 "tuto_docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
68 "tuto_git": ("https://gdevops.gitlab.io/tuto_git/", None),
69 "tuto_http": ("https://gdevops.gitlab.io/tuto_http/", None),
70 "tuto_ides": ("https://gdevops.gitlab.io/tuto_ides/", None),
71 "tudo_sysops": ("https://gdevops.gitlab.io/tuto_sysops/", None),
72 "tuto_doc": ("https://gdevops.gitlab.io/documentation/tuto/", None),
73 "doc_formats": ("https://gdevops.gitlab.io/documentation/formats/", None),
74 "tuto_webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
75 "tuto_django": ("https://gdevops.gitlab.io/django/tuto/", None),
76 "tuto_languages": ("https://gdevops.gitlab.io/tuto_languages/", None),
77 "tuto_secops": ("https://gdevops.gitlab.io/tuto_secops/", None),
78 "tuto_fediverse": ("https://gdevops.gitlab.io/tuto_fediverse/", None),
79}
80extensions.append("sphinx.ext.todo")
81todo_include_todos = True
82
83
84# Panels config
85panels_add_bootstrap_css = False
86
87# autoclasstoc + napoleon + autodoc
88# https://autoclasstoc.readthedocs.io/en/latest/basic_usage.html
89extensions += [
90 "sphinx.ext.napoleon",
91 "sphinx.ext.autodoc",
92 "sphinx.ext.autosummary",
93 "sphinx.ext.viewcode",
94]
95
96
97# material theme options (see theme.conf for more information)
98# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
99# Colors
100# The theme color for mobile browsers. Hex color.
101# theme_color = #3f51b5
102# Primary colors:
103# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
104# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
105# brown, grey, blue-grey, white
106# Accent colors:
107# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
108# teal, green, light-green, lime, yellow, amber, orange, deep-orange
109# color_accent = blue
110# color_primary = blue-grey
111
112# material theme options (see theme.conf for more information)
113html_theme_options = {
114 "base_url": "https://gdevops.gitlab.io/tuto_project/",
115 "repo_url": "https://gitlab.com/gdevops/tuto_project",
116 "repo_name": project,
117 "html_minify": False,
118 "html_prettify": True,
119 "css_minify": True,
120 "repo_type": "gitlab",
121 "globaltoc_depth": -1,
122 "color_primary": "green",
123 "color_accent": "cyan",
124 "theme_color": "#2196f3",
125 "master_doc": False,
126 "nav_links": [
127 {
128 "href": "genindex",
129 "internal": True,
130 "title": "Index",
131 },
132 {
133 "href": "https://gdevops.gitlab.io/tuto_devops/",
134 "internal": False,
135 "title": "Tutos devops",
136 },
137 ],
138 "heroes": {
139 "index": "Tuto Project",
140 },
141 "table_classes": ["plain"],
142}
143
144
145language = "en"
146html_last_updated_fmt = ""
147
148todo_include_todos = True
149
150html_use_index = True
151html_domain_indices = True
152
153copyright = f"2018-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"