aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/source/conf.py
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2024-10-05 18:10:34 +0800
committerHsiangNianian <i@jyunko.cn>2024-10-05 18:10:34 +0800
commit4c8caa60508f1c23b21343b82bfba525b8c610a5 (patch)
treea40cd59eb78d60349431d977f11587cbc97fb9ac /docs/source/conf.py
parente614fd92c3288dd862ffb696cacaa9aadd11516c (diff)
downloadHydroRoll-4c8caa60508f1c23b21343b82bfba525b8c610a5.tar.gz
HydroRoll-4c8caa60508f1c23b21343b82bfba525b8c610a5.zip
feat(docs): update requirements and docs content with new sphinx extensions and translations
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r--docs/source/conf.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 4496f04..fa4794e 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -10,6 +10,9 @@ if sys.version_info >= (3, 11):
else:
import tomli as tomllib
+def setup(app):
+ app.add_config_value('releaselevel', '', 'env')
+
DATA = None
PYPROJECT = os.path.join("..", "..", "Cargo.toml")
with open(PYPROJECT, "r", encoding="utf8") as f:
@@ -35,15 +38,33 @@ author = AUTHORS # "Hsiang Nianian"
extensions = [
"sphinx.ext.autodoc",
+ "sphinx.ext.autosectionlabel",
+ "sphinx.ext.coverage",
+ "sphinx.ext.doctest",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
"sphinx.ext.extlinks",
+ "sphinx.ext.graphviz",
+ "sphinx.ext.inheritance_diagram",
+ "sphinx.ext.imgmath",
"sphinx.ext.intersphinx",
+ "sphinxcontrib.httpdomain",
+ "sphinx.ext.ifconfig",
"myst_parser",
]
+doctest_global_setup = '''
+try:
+ import hydro_roll as hr
+ import hydro_roll_core as hrc
+except ImportError:
+ hr = None
+ hrc = None
+'''
+todo_include_todos = True
+todo_emit_warnings = True
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
@@ -55,6 +76,14 @@ source_suffix = {
".txt": "markdown",
".md": "markdown",
}
+rst_prolog = """
+.. ifconfig:: releaselevel in ('alpha', 'beta', 'rc')
+
+ .. warning::
+
+ This stuff is only included in the built docs for unstable versions.
+
+"""
rst_epilog = """
.. |psf| replace:: Python Software Foundation
"""
@@ -62,7 +91,7 @@ locale_dirs = ["../locales/"] # path is example but recommended.
gettext_compact = False # optional.
gettext_uuid = True # optional.
numfig = True # Figures, tables and code blocks are automatically numbered if they have a title
-pygments_style = "colorful" # default sphinx, change the style of code block
+pygments_style = "rrt" # default sphinx, change the style of code block
math_number_all = True # Number all equations, figures, tables and code blocks
html_additional_pages = {
'copy': 'copying.html',