2020-11-06 10:44:25 +00:00
|
|
|
#!/usr/bin/env python3
|
2022-05-13 09:44:23 +00:00
|
|
|
import datetime
|
2020-11-06 10:44:25 +00:00
|
|
|
import os
|
|
|
|
import sys
|
2023-06-03 13:37:24 +00:00
|
|
|
from importlib import metadata
|
2021-12-20 22:57:27 +00:00
|
|
|
from unittest import mock
|
2020-11-06 10:44:25 +00:00
|
|
|
|
2020-11-06 12:47:47 +00:00
|
|
|
sys.path.insert(0, os.path.abspath(".."))
|
|
|
|
sys.path.insert(0, os.path.abspath("../canaille"))
|
2020-11-06 10:44:25 +00:00
|
|
|
|
2020-11-06 12:47:47 +00:00
|
|
|
|
|
|
|
# Readthedocs does not support C modules, so
|
|
|
|
# we have to mock them.
|
|
|
|
|
|
|
|
|
|
|
|
class Mock(mock.MagicMock):
|
|
|
|
@classmethod
|
|
|
|
def __getattr__(cls, name):
|
|
|
|
return mock.MagicMock()
|
|
|
|
|
|
|
|
|
|
|
|
MOCK_MODULES = ["ldap"]
|
|
|
|
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
|
|
|
|
2020-11-06 10:44:25 +00:00
|
|
|
# -- General configuration ------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
extensions = [
|
|
|
|
"sphinx.ext.autodoc",
|
2023-12-24 14:59:39 +00:00
|
|
|
"sphinx.ext.autosectionlabel",
|
2020-11-06 10:44:25 +00:00
|
|
|
"sphinx.ext.doctest",
|
|
|
|
"sphinx.ext.graphviz",
|
|
|
|
"sphinx.ext.intersphinx",
|
|
|
|
"sphinx.ext.todo",
|
|
|
|
"sphinx.ext.viewcode",
|
2024-05-08 08:25:24 +00:00
|
|
|
"sphinx_click",
|
2020-11-06 10:44:25 +00:00
|
|
|
"sphinx_issues",
|
2024-03-27 20:17:30 +00:00
|
|
|
"sphinx_sitemap",
|
2023-12-18 17:06:03 +00:00
|
|
|
"sphinxcontrib.autodoc_pydantic",
|
2020-11-06 10:44:25 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
templates_path = ["_templates"]
|
2024-03-28 13:22:07 +00:00
|
|
|
source_suffix = {
|
|
|
|
".rst": "restructuredtext",
|
|
|
|
".md": "markdown",
|
|
|
|
}
|
2020-11-06 10:44:25 +00:00
|
|
|
master_doc = "index"
|
|
|
|
project = "canaille"
|
2022-05-13 09:44:23 +00:00
|
|
|
year = datetime.datetime.now().strftime("%Y")
|
|
|
|
copyright = f"{year}, Yaal Coop"
|
|
|
|
author = "Yaal Coop"
|
2020-11-06 10:44:25 +00:00
|
|
|
|
2024-03-27 20:17:30 +00:00
|
|
|
version = metadata.version("canaille")
|
2022-11-04 08:32:41 +00:00
|
|
|
language = "en"
|
2020-11-06 10:44:25 +00:00
|
|
|
exclude_patterns = []
|
|
|
|
pygments_style = "sphinx"
|
|
|
|
todo_include_todos = False
|
|
|
|
|
|
|
|
intersphinx_mapping = {
|
|
|
|
"python": ("https://docs.python.org/3", None),
|
2023-12-24 14:59:39 +00:00
|
|
|
"authlib": ("https://docs.authlib.org/en/latest", None),
|
|
|
|
"flask": ("https://flask.palletsprojects.com", None),
|
|
|
|
"flask-babel": ("https://python-babel.github.io/flask-babel", None),
|
|
|
|
"flask-wtf": ("https://flask-wtf.readthedocs.io", None),
|
2023-12-18 17:06:03 +00:00
|
|
|
"pydantic": ("https://docs.pydantic.dev/latest", None),
|
2020-11-06 10:44:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
issues_uri = "https://gitlab.com/yaal/canaille/-/issues/{issue}"
|
|
|
|
issues_pr_uri = "https://gitlab.com/yaal/canaille/-/merge_requests/{pr}"
|
|
|
|
issues_commit_uri = "https://gitlab.com/yaal/canaille/-/commit/{commit}"
|
|
|
|
|
|
|
|
# -- Options for HTML output ----------------------------------------------
|
|
|
|
|
2024-03-27 13:58:07 +00:00
|
|
|
html_theme = "shibuya"
|
2024-03-27 21:45:50 +00:00
|
|
|
html_static_path = ["_static"]
|
2024-03-27 20:17:30 +00:00
|
|
|
html_baseurl = "https://canaille.readthedocs.io/"
|
2024-03-27 13:58:07 +00:00
|
|
|
html_theme_options = {
|
|
|
|
"accent_color": "yellow",
|
2024-03-27 21:45:50 +00:00
|
|
|
"light_logo": "_static/canaille-label-black.webp",
|
|
|
|
"dark_logo": "_static/canaille-label-white.webp",
|
2024-03-27 13:58:07 +00:00
|
|
|
"gitlab_url": "https://gitlab.com/yaal/canaille",
|
|
|
|
"mastodon_url": "https://toot.aquilenet.fr/@yaal",
|
|
|
|
"nav_links": [
|
|
|
|
{
|
|
|
|
"title": "Homepage",
|
|
|
|
"url": "https://canaille.yaal.coop",
|
|
|
|
"summary": "The homepage for the Canaille project",
|
|
|
|
},
|
|
|
|
{"title": "PyPI", "url": "https://pypi.org/project/Canaille/"},
|
|
|
|
],
|
|
|
|
}
|
2020-11-06 10:44:25 +00:00
|
|
|
|
|
|
|
# -- Options for HTMLHelp output ------------------------------------------
|
|
|
|
|
|
|
|
htmlhelp_basename = "canailledoc"
|
|
|
|
|
|
|
|
|
|
|
|
# -- Options for LaTeX output ---------------------------------------------
|
|
|
|
|
|
|
|
latex_elements = {}
|
|
|
|
latex_documents = [
|
|
|
|
(master_doc, "canaille.tex", "canaille Documentation", "Yaal", "manual")
|
|
|
|
]
|
|
|
|
|
|
|
|
# -- Options for manual page output ---------------------------------------
|
|
|
|
|
|
|
|
man_pages = [(master_doc, "canaille", "canaille Documentation", [author], 1)]
|
|
|
|
|
|
|
|
# -- Options for Texinfo output -------------------------------------------
|
|
|
|
|
|
|
|
texinfo_documents = [
|
|
|
|
(
|
|
|
|
master_doc,
|
|
|
|
"canaille",
|
|
|
|
"canaille Documentation",
|
|
|
|
author,
|
|
|
|
"canaille",
|
|
|
|
"One line description of project.",
|
|
|
|
"Miscellaneous",
|
|
|
|
)
|
|
|
|
]
|
2023-12-24 14:59:39 +00:00
|
|
|
|
|
|
|
# -- Options for autosectionlabel -----------------------------------------
|
|
|
|
|
|
|
|
autosectionlabel_prefix_document = True
|
|
|
|
autosectionlabel_maxdepth = 2
|
2023-12-18 17:06:03 +00:00
|
|
|
|
|
|
|
# -- Options for autodo_pydantic_settings -------------------------------------------
|
|
|
|
|
|
|
|
autodoc_pydantic_settings_show_json = False
|
|
|
|
autodoc_pydantic_settings_show_config_summary = False
|
|
|
|
autodoc_pydantic_settings_show_config_summary = False
|
|
|
|
autodoc_pydantic_settings_show_validator_summary = False
|
|
|
|
autodoc_pydantic_settings_show_validator_members = False
|
|
|
|
autodoc_pydantic_settings_show_field_summary = False
|
|
|
|
autodoc_pydantic_field_list_validators = False
|