xref: /DragonOS/docs/conf.py (revision c635d8a9cfe25bc11779f323ef0c7d7a0f597d4a)
1# Configuration file for the Sphinx documentation builder.
2#
3# This file only contains a selection of the most common options. For a full
4# list see the documentation:
5# https://www.sphinx-doc.org/en/master/usage/configuration.html
6
7# -- Path setup --------------------------------------------------------------
8
9# If extensions (or modules to document with autodoc) are in another directory,
10# add these directories to sys.path here. If the directory is relative to the
11# documentation root, use os.path.abspath to make it absolute, like shown here.
12#
13import os
14# import sys
15# sys.path.insert(0, os.path.abspath('.'))
16
17# -- Project information -----------------------------------------------------
18
19project = 'DragonOS'
20copyright = '2022-2024, DragonOS Community'
21author = 'longjin'
22
23# The full version, including alpha/beta/rc tags
24release = 'dev'
25
26
27# -- General configuration ---------------------------------------------------
28
29# Add any Sphinx extension module names here, as strings. They can be
30# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31# ones.
32extensions = ['myst_parser', 'sphinx_multiversion']
33
34# Add any paths that contain templates here, relative to this directory.
35templates_path = ['_templates']
36
37# The language for content autogenerated by Sphinx. Refer to documentation
38# for a list of supported languages.
39#
40# This is also used if you do content translation via gettext catalogs.
41# Usually you set "language" from the command line for these cases.
42language = 'zh_CN'
43
44# List of patterns, relative to source directory, that match files and
45# directories to ignore when looking for source files.
46# This pattern also affects html_static_path and html_extra_path.
47exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
48source_suffix = ['.rst', '.md']
49
50# -- Options for HTML output -------------------------------------------------
51
52# The theme to use for HTML and HTML Help pages.  See the documentation for
53# a list of builtin themes.
54#
55html_theme = 'sphinx_rtd_theme'
56
57# Add any paths that contain custom static files (such as style sheets) here,
58# relative to this directory. They are copied after the builtin static files,
59# so a file named "default.css" will overwrite the builtin "default.css".
60html_static_path = ['_static']
61
62html_sidebars = {
63    '**': [
64        'versioning.html',
65    ],
66}
67
68myst_enable_extensions = [
69    "amsmath",
70    "colon_fence",
71    "deflist",
72    "dollarmath",
73    "fieldlist",
74    "html_admonition",
75    "html_image",
76    "replacements",
77    "smartquotes",
78    "strikethrough",
79    "substitution",
80    "tasklist",
81]
82
83# sphinx-multiversion 指定哪个分支为 lastest 版本
84smv_latest_version = 'master'
85smv_released_pattern = r'^tags/.*$'           # Tags only
86smv_tag_whitelist = r'^(V.*|v.*)$'
87smv_branch_whitelist = "master"
88
89# Define the canonical URL if you are using a custom domain on Read the Docs
90html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
91
92# Tell Jinja2 templates the build is running on Read the Docs
93if os.environ.get("READTHEDOCS", "") == "True":
94    html_context["READTHEDOCS"] = True