🎛️ Defaults¶
When the confirm.sphinx extension is added to the extensions, it applies the common Sphinx settings of all our documentations and you only have to set project.
The extension only sets values which aren’t defined in your conf.py or via sphinx-build -D.
So whatever you set yourself always wins.
Most values depend on GitLab CI/CD variables. That way, a docs build in a pipeline automatically knows
its source links,
its release,
whether todos should be visible.
CI/CD variables¶
The defaults read these environment variables:
#
# 🤖 marvinCI variables.
#
mci_deploy_tagless = environ.get('MCI_DEPLOY_TAGLESS', '') # todos
#
# 🦊 GitLab CI variables.
#
# Read some predefined GitLab CI variables to configure the source links, the release, and the
# conditional todo visibility.
#
ci_project_url = environ.get('CI_PROJECT_URL') # source
ci_default_branch = environ.get('CI_DEFAULT_BRANCH', 'main') # source, todos
ci_commit_ref_slug = environ.get('CI_COMMIT_REF_SLUG', 'unknown') # source, release, todos
ci_commit_tag = environ.get('CI_COMMIT_TAG') # release, todos
Note
Running sphinx-build locally, outside of a pipeline, works fine.
The release is unknown and the source links are missing, that’s all.
Settings¶
html_themeSet to
confirm-sphinx.html_faviconThe confirm IT docs icon, loaded from
https://assets.confirm.ch/icon-variants/sphinx.svg.html_theme_optionsWhen
CI_PROJECT_URLis set, it adds Furo’ssource_view_linkandsource_edit_link. They’re merged into your ownhtml_theme_options, so your options and the source links work side by side. They point todocs/in the GitLab project:On a tag, they point to the default branch.
On a branch, they point to the current branch.
Without
CI_PROJECT_URL, your options stay untouched.html_titleYour
projectname, e.g. in the sidebar and the browser tab, instead of Sphinx’s<project> <release> documentation.authorconfirm ITcopyrightThe current year and the author, e.g.
2026, confirm IT.releaseThe tag name (
CI_COMMIT_TAG), otherwise the branch slug (CI_COMMIT_REF_SLUG).languageenautodoc_typehintsdescription, so type hints show up in the parameter descriptions instead of the signature.autosectionlabel_maxdepth3, so only the page title and the first two section levels get a label. This avoids duplicate label warnings for common deeper headings like “Examples”.extensionsSee Extensions below.
todo_link_onlyTrue, so the todo list only shows a link to the todo instead of its source path.todo_include_todosSee Todo visibility below.
mermaid_init_configRenders Mermaid labels as SVG text instead of HTML, so diagrams look the same everywhere (e.g. in exports).
{ 'startOnLoad': False, 'htmlLabels': False, 'flowchart': {'htmlLabels': False}, }
If you set your own
mermaid_init_config, it replaces this one completely, so include'startOnLoad': False.
Extensions¶
The confirm-sphinx extension always installs and enables these extensions:
#
# 🧩 Enabled default extensions.
#
EXTENSIONS = (
'sphinx.ext.autodoc', # Generate docs from Python docstrings
'sphinx.ext.autosectionlabel', # Reference sections by their title, e.g. :ref:`Extensions`
'sphinx.ext.extlinks', # Shorten external links via roles defined in extlinks
'sphinx.ext.ifconfig', # Include content based on config values
'sphinx.ext.intersphinx', # Link to other projects' documentation
'sphinx.ext.napoleon', # Support Google & NumPy style docstrings
'sphinx.ext.todo', # Support todo directives, hidden in releases
'sphinxcontrib.mermaid', # Render Mermaid diagrams via .. mermaid::
'sphinx_paramlinks', # Make parameters linkable, e.g. :paramref:`func.param`
)
Hint
sphinxcontrib-django is installed as well, but it’s not enabled.
Add sphinxcontrib_django to extensions in Django projects to improve the autodoc output for models & co.
You don’t need to list the extensions above in your conf.py, but it doesn’t hurt either.
Todo visibility¶
Todos are meant for drafts, not for releases.
That’s why todo_include_todos shows them only on work-in-progress builds:
Build |
Todos |
|---|---|
Tag |
🙈 Hidden |
Default branch with |
🙈 Hidden |
Any other branch |
👀 Shown |
The same rule marks the release in the sidebar with 🚧 on work-in-progress builds, unless you set release yourself.