coreboot/Documentation/conf.py
Nicholas Chin 2b45b7a54b Docs/conf.py: Explicitly define external URL schemes
By default, any URL with a scheme of "http", "https", "ftp", or "mailto"
is treated as an external link. Since the "ircs" scheme is not included,
the IRC link in community/forums.md does not get resolved as an external
link, and instead tries to link to a header in the docs themselves. Fix
this by explicitly defining which schemes should resolve to external
links using the myst_url_schemes configuration option [1], which is now
set to the default schemes along with "ircs".

This fixes the "cross-reference target not found" warning for
'ircs://irc.libera.chat/#coreboot'

[1] https://myst-parser.readthedocs.io/en/latest/syntax/cross-referencing.html#customising-external-url-resolution

Change-Id: I9e1c76b2bacbacaa06340f940c76b50de38e43e8
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84069
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-08-25 15:20:37 +00:00

56 lines
1.8 KiB
Python

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import subprocess
project = 'coreboot'
copyright = 'CC-by 4.0 the coreboot project'
author = 'the coreboot project'
release = subprocess.check_output(('git', 'describe')).decode("utf-8")
# The short X.Y version.
version = release.split("-")[0]
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ["myst_parser"]
myst_heading_anchors = 5
myst_url_schemes = ["http", "https", "mailto", "ftp", "ircs"]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# Try to load DITAA
try:
import sphinxcontrib.ditaa
except ImportError:
print("Error: Please install sphinxcontrib.ditaa for ASCII art conversion\n")
else:
extensions += ['sphinxcontrib.ditaa']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_css_files = [
'theme_overrides.css', # override wide tables in RTD theme
]