Files
pmaports-rtwo/docs/conf.py
T
Stefan Hansson d6834e89f3 docs: raise exception if dint reports an error
Currently, even if dint fails for some reason, the documentation
generation continues on. This is not good as it hides problems until
someone manually discovers them. Fix this by checking the exit code of
dint and raising an exception if it isn't zero.

To facilitate this, also replace call() with run() since it's a more
modern and more flexible API.

Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7982>
2026-02-11 01:01:45 +00:00

37 lines
1018 B
Python

# Configuration file for the Sphinx documentation builder.
import datetime
from pathlib import Path
import subprocess
project = "pmaports"
copyright = str(datetime.date.today().year) + ", postmarketOS contributors"
exclude_patterns = ["_build", "_out", "Thumbs.db", ".DS_Store", ".venv", "README.md"]
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinxcontrib.autoprogram",
"sphinxcontrib.jquery",
]
html_theme = "pmos"
html_theme_options = {
# FIXME: This should be main once we rename the branch
"source_edit_link": "https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/docs/{filename}",
}
# Set the explicit title of the HTML output
html_title = "postmarketOS Packaging"
def run_dint_doc(app):
with Path(__file__).parent.joinpath("deviceinfo-reference.md").open("w") as f:
subprocess.run(["dint", "doc"], stdout=f, check=True)
def setup(app):
app.connect("builder-inited", run_dint_doc)