qubes-doc/conf.py
parulin 511120b7a0
Cleanup sphinx and readthedocs configurations
* Use dirhtml as default builder for readthedocs (clean URLs)
* The configuration variables are now sorted with respect to the Sphinx
  documentation
* Remove useless comments in conf.py
* Add new comments for each section, following Sphinx documentation
  order
* The code corresponding to videos have been moved from config to a
  dedicated extension.
* Use proper HTML theme options
* Exclude all files starting with `.`, `_` (sphinx convention)
* Use OpenSearch
2025-08-01 11:20:35 -04:00

104 lines
2.6 KiB
Python

"""qubes-doc configuration file"""
import os
import sys
from pathlib import Path
sys.path.append(str(Path('_ext').resolve()))
# For the full list of options, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
project = 'Qubes OS'
author = 'Qubes OS Project'
copyright = f'%Y, {author}'
# Warning: Sphinx's version and release differ from Qubes OS !
# The major project version, used as the replacement for the |version| default
# substitution. i.e. '4.3'
version = '4.2'
# The full version, including alpha/beta/rc tags
release = '4.2.4'
# -- General configuration ---------------------------------------------------
extensions = [
'sphinx.ext.autosectionlabel',
'sphinxnotes.strike',
'sphinx_reredirects',
'videos',
]
redirects = {
"user/hardware/hcl":
"https://www.qubes-os.org/hcl/",
"user/downloading-installing-upgrading/downloads:mirrors":
"https://www.qubes-os.org/downloads/mirrors/",
"developer/general/visual-style-guide":
"https://www.qubes-os.org/doc/visual-style-guide/",
"developer/general/website-style-guide":
"https://www.qubes-os.org/doc/website-style-guide/",
"user/downloading-installing-upgrading/downloads":
"https://www.qubes-os.org/downloads/",
"developer/general/how-to-edit-the-documentation":
"https://www.qubes-os.org/doc/how-to-edit-the-documentation/",
}
# -- -- Options for highlighting ---------------------------------------------
highlight_language = 'none'
# -- -- Options for source files ---------------------------------------------
exclude_patterns = [
'_*',
'**/.*',
'**/*.txt'
'attachment',
]
# -- Builder options ---------------------------------------------------------
# -- -- Options for HTML output ----------------------------------------------
html_theme = 'sphinx_rtd_theme'
html_title = f'{project} {release} Documentation'
html_theme_options = {
'style_external_links': True,
'body_min_width': '50%',
'body_max_width': '90%',
'collapse_navigation': True,
}
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "/")
html_static_path = ['attachment/doc']
html_use_opensearch = "https://doc.qubes-os.org"
# -- Extensions configuration ------------------------------------------------
autosectionlabel_prefix_document = True
# -- HTML configuration ------------------------------------------------------
# -- -- Options for internationalisation -------------------------------------
locale_dirs = ['_translated']
gettext_compact = False
gettext_uuid = True