xref: /DragonOS/docs/conf.py (revision ef2a79be603d758f104482c0a7fe3d4d79f53dc3)
10d0705a1Slongjin# Configuration file for the Sphinx documentation builder.
20d0705a1Slongjin#
30d0705a1Slongjin# This file only contains a selection of the most common options. For a full
40d0705a1Slongjin# list see the documentation:
50d0705a1Slongjin# https://www.sphinx-doc.org/en/master/usage/configuration.html
60d0705a1Slongjin
70d0705a1Slongjin# -- Path setup --------------------------------------------------------------
80d0705a1Slongjin
90d0705a1Slongjin# If extensions (or modules to document with autodoc) are in another directory,
100d0705a1Slongjin# add these directories to sys.path here. If the directory is relative to the
110d0705a1Slongjin# documentation root, use os.path.abspath to make it absolute, like shown here.
120d0705a1Slongjin#
13*ef2a79beSLoGinimport os
140d0705a1Slongjin# import sys
150d0705a1Slongjin# sys.path.insert(0, os.path.abspath('.'))
160d0705a1Slongjin
170d0705a1Slongjin# -- Project information -----------------------------------------------------
180d0705a1Slongjin
190d0705a1Slongjinproject = 'DragonOS'
20*ef2a79beSLoGincopyright = '2022-2024, DragonOS Community'
2145b83711Sloginauthor = 'longjin'
220d0705a1Slongjin
230d0705a1Slongjin# The full version, including alpha/beta/rc tags
240d0705a1Slongjinrelease = 'dev'
250d0705a1Slongjin
260d0705a1Slongjin
270d0705a1Slongjin# -- General configuration ---------------------------------------------------
280d0705a1Slongjin
290d0705a1Slongjin# Add any Sphinx extension module names here, as strings. They can be
300d0705a1Slongjin# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
310d0705a1Slongjin# ones.
320d0705a1Slongjinextensions = ['myst_parser']
330d0705a1Slongjin
340d0705a1Slongjin# Add any paths that contain templates here, relative to this directory.
350d0705a1Slongjintemplates_path = ['_templates']
360d0705a1Slongjin
370d0705a1Slongjin# The language for content autogenerated by Sphinx. Refer to documentation
380d0705a1Slongjin# for a list of supported languages.
390d0705a1Slongjin#
400d0705a1Slongjin# This is also used if you do content translation via gettext catalogs.
410d0705a1Slongjin# Usually you set "language" from the command line for these cases.
420d0705a1Slongjinlanguage = 'zh_CN'
430d0705a1Slongjin
440d0705a1Slongjin# List of patterns, relative to source directory, that match files and
450d0705a1Slongjin# directories to ignore when looking for source files.
460d0705a1Slongjin# This pattern also affects html_static_path and html_extra_path.
470d0705a1Slongjinexclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
480d0705a1Slongjinsource_suffix = ['.rst', '.md']
490d0705a1Slongjin
500d0705a1Slongjin# -- Options for HTML output -------------------------------------------------
510d0705a1Slongjin
520d0705a1Slongjin# The theme to use for HTML and HTML Help pages.  See the documentation for
530d0705a1Slongjin# a list of builtin themes.
540d0705a1Slongjin#
550d0705a1Slongjinhtml_theme = 'sphinx_rtd_theme'
560d0705a1Slongjin
570d0705a1Slongjin# Add any paths that contain custom static files (such as style sheets) here,
580d0705a1Slongjin# relative to this directory. They are copied after the builtin static files,
590d0705a1Slongjin# so a file named "default.css" will overwrite the builtin "default.css".
600d0705a1Slongjinhtml_static_path = ['_static']
6155e63fcbSfslongjin
6255e63fcbSfslongjinmyst_enable_extensions = [
63ed594f10Sfslongjin    "amsmath",
64ed594f10Sfslongjin    "colon_fence",
65ed594f10Sfslongjin    "deflist",
66ed594f10Sfslongjin    "dollarmath",
67ed594f10Sfslongjin    "fieldlist",
68ed594f10Sfslongjin    "html_admonition",
69ed594f10Sfslongjin    "html_image",
70ed594f10Sfslongjin    "replacements",
71ed594f10Sfslongjin    "smartquotes",
72ed594f10Sfslongjin    "strikethrough",
73ed594f10Sfslongjin    "substitution",
7455e63fcbSfslongjin    "tasklist",
7555e63fcbSfslongjin]
76*ef2a79beSLoGin
77*ef2a79beSLoGin
78*ef2a79beSLoGin# Define the canonical URL if you are using a custom domain on Read the Docs
79*ef2a79beSLoGinhtml_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
80*ef2a79beSLoGin
81*ef2a79beSLoGin# Tell Jinja2 templates the build is running on Read the Docs
82*ef2a79beSLoGinif os.environ.get("READTHEDOCS", "") == "True":
83*ef2a79beSLoGin    html_context["READTHEDOCS"] = True