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
22# If extensions (or modules to document with autodoc) are in another directory,
23# add these directories to sys.path here. If the directory is relative to the
24# documentation root, use os.path.abspath to make it absolute, like shown here.
25# sys.path.insert(0, os.path.abspath("./src"))
26
27project = "Tuto programming"
28html_title = project
29
30author = f"DevOps people"
31html_logo = "images/katie_bouman.jpeg"
32html_favicon = "images/katie_bouman.jpeg"
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 "sphinx_copybutton",
47]
48extensions += ["sphinx.ext.intersphinx"]
49
50
51autosummary_generate = True
52autoclass_content = "class"
53
54# Add any paths that contain templates here, relative to this directory.
55templates_path = ["_templates"]
56exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
57html_static_path = ["_static"]
58html_show_sourcelink = True
59html_sidebars = {
60 "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
61}
62extensions.append("sphinx_material")
63html_theme_path = sphinx_material.html_theme_path()
64html_context = sphinx_material.get_html_context()
65html_theme = "sphinx_material"
66
67extensions.append("sphinx.ext.intersphinx")
68intersphinx_mapping = {
69 "python": ("https://gdevops.gitlab.io/python/tuto/", None),
70 "git": ("https://gdevops.gitlab.io/tuto_git/", None),
71 "languages": ("https://gdevops.gitlab.io/tuto_languages/", None),
72 "tuto_programming": ("https://gdevops.gitlab.io/tuto_programming/", None),
73 "django": ("https://gdevops.gitlab.io/django/tuto/", None),
74 "docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
75 "databases": ("https://gdevops.gitlab.io/tuto_databases/", None),
76 "javascript": ("https://gdevops.gitlab.io/tuto_javascript/", None),
77 "sphinx": ("https://www.sphinx-doc.org/en/master", None),
78 "sphinx_material": ("https://gdevops.gitlab.io/tuto_sphinx_material", None),
79 "iran_luttes": ("https://iran.frama.io/luttes/", None),
80}
81extensions.append("sphinx.ext.todo")
82todo_include_todos = True
83
84
85# material theme options (see theme.conf for more information)
86# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
87# Colors
88# The theme color for mobile browsers. Hex color.
89# theme_color = #3f51b5
90# Primary colors:
91# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
92# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
93# brown, grey, blue-grey, white
94# Accent colors:
95# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
96# teal, green, light-green, lime, yellow, amber, orange, deep-orange
97# color_accent = blue
98# color_primary = blue-grey
99
100# material theme options (see theme.conf for more information)
101html_theme_options = {
102 "base_url": "https://gdevops.gitlab.io/tuto_programming/",
103 "repo_url": "https://gitlab.com/gdevops/tuto_programming",
104 "repo_name": project,
105 "html_minify": False,
106 "html_prettify": True,
107 "css_minify": True,
108 "repo_type": "gitlab",
109 "globaltoc_depth": -1,
110 "color_primary": "green",
111 "color_accent": "cyan",
112 "theme_color": "#2196f3",
113 "nav_title": f"{project} ({today})",
114 "master_doc": False,
115 "nav_links": [
116 {
117 "href": "genindex",
118 "internal": True,
119 "title": "Index",
120 },
121 {
122 "href": "https://gdevops.gitlab.io/python/tuto",
123 "internal": False,
124 "title": "Tuto python",
125 },
126 {
127 "href": "https://gdevops.gitlab.io/tuto_devops/",
128 "internal": False,
129 "title": "Tutos devops",
130 },
131 ],
132 "heroes": {
133 "index": "Tuto programming",
134 },
135 "table_classes": ["plain"],
136}
137
138
139language = "en"
140html_last_updated_fmt = ""
141
142todo_include_todos = True
143
144html_use_index = True
145html_domain_indices = True
146
147
148copyright = f"2018-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"