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 Django"
27html_title = project
28
29author = "DevOps people"
30html_logo = "images/django-logo-negative.png"
31html_favicon = "images/django-logo-negative.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]
47extensions += ["sphinx.ext.intersphinx"]
48
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 "django": (
69 "http://docs.djangoproject.com/en/dev/",
70 "http://docs.djangoproject.com/en/dev/_objects/",
71 ),
72 "python": ("https://gdevops.gitlab.io/tuto_python/", None),
73 "tuto_databases": ("https://gdevops.gitlab.io/tuto_databases/", None),
74 "psycopg2": ("https://www.psycopg.org/docs/", None),
75 "docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
76 "git": ("https://gdevops.gitlab.io/tuto_git/", None),
77 "languages": ("https://gdevops.gitlab.io/tuto_languages/", None),
78 "sysops": ("https://gdevops.gitlab.io/tuto_sysops/", None),
79 "javascript": ("https://gdevops.gitlab.io/tuto_javascript/", None),
80 "build": ("https://gdevops.gitlab.io/tuto_build/", None),
81 "project": ("https://gdevops.gitlab.io/tuto_project/", None),
82 "tuto_secops": ("https://gdevops.gitlab.io/tuto_secops/", None),
83 "tuto_htmx": ("https://gdevops.gitlab.io/tuto_htmx/", None),
84 "tuto_html": ("https://gdevops.gitlab.io/tuto_html/", None),
85 "databases": ("https://gdevops.gitlab.io/tuto_databases/", None),
86 "webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
87 "programming": ("https://gdevops.gitlab.io/tuto_programming/", None),
88 "http": ("https://gdevops.gitlab.io/tuto_http/", None),
89 "sphinx_material": ("https://gdevops.gitlab.io/tuto_sphinx_material", None),
90}
91extensions.append("sphinx.ext.todo")
92todo_include_todos = True
93
94# material theme options (see theme.conf for more information)
95# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
96# Colors
97# The theme color for mobile browsers. Hex color.
98# theme_color = #3f51b5
99# Primary colors:
100# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
101# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
102# brown, grey, blue-grey, white
103# Accent colors:
104# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
105# teal, green, light-green, lime, yellow, amber, orange, deep-orange
106# color_accent = blue
107# color_primary = blue-grey
108
109# material theme options (see theme.conf for more information)
110html_theme_options = {
111 "base_url": "https://gdevops.gitlab.io/tuto_django/",
112 "repo_url": "https://gitlab.com/gdevops/tuto_django/",
113 "repo_name": project,
114 "html_minify": False,
115 "html_prettify": True,
116 "css_minify": True,
117 "repo_type": "gitlab",
118 "globaltoc_depth": -1,
119 "color_primary": "green",
120 "color_accent": "cyan",
121 "theme_color": "#2196f3",
122 "master_doc": False,
123 "nav_title": f"{project} ({today})",
124 "nav_links": [
125 {
126 "href": "genindex",
127 "internal": True,
128 "title": "Index",
129 },
130 {
131 "href": "https://awesomedjango.org/",
132 "internal": False,
133 "title": "Awsome Django",
134 },
135 {
136 "href": "https://gdevops.gitlab.io/tuto_htmx/",
137 "internal": False,
138 "title": "Tuto HTMX",
139 },
140 {
141 "href": "https://gdevops.gitlab.io/tuto_http/",
142 "internal": False,
143 "title": "Tuto HTTP",
144 },
145 {
146 "href": "https://gdevops.gitlab.io/tuto_devops/",
147 "internal": False,
148 "title": "Tuto devops",
149 },
150 ],
151 "heroes": {
152 "index": "Tuto Django",
153 },
154 "table_classes": ["plain"],
155}
156
157
158language = "en"
159html_last_updated_fmt = ""
160
161todo_include_todos = True
162
163html_use_index = True
164html_domain_indices = True
165
166
167copyright = f"2018-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"