xref: /DragonOS/docs/conf.py (revision ef2a79be603d758f104482c0a7fe3d4d79f53dc3)
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']
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
62myst_enable_extensions = [
63    "amsmath",
64    "colon_fence",
65    "deflist",
66    "dollarmath",
67    "fieldlist",
68    "html_admonition",
69    "html_image",
70    "replacements",
71    "smartquotes",
72    "strikethrough",
73    "substitution",
74    "tasklist",
75]
76
77
78# Define the canonical URL if you are using a custom domain on Read the Docs
79html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
80
81# Tell Jinja2 templates the build is running on Read the Docs
82if os.environ.get("READTHEDOCS", "") == "True":
83    html_context["READTHEDOCS"] = True