Verified Commit b3979a7d authored by Rahix's avatar Rahix
Browse files

chore(docs): Format conf.py



Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 374010e0
...@@ -20,9 +20,9 @@ project = "card10-firmware" ...@@ -20,9 +20,9 @@ project = "card10-firmware"
copyright = "2019" copyright = "2019"
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = subprocess.check_output( release = (
["git", "describe", "--long", "--always"] subprocess.check_output(["git", "describe", "--long", "--always"]).decode().strip()
).decode().strip() )
release += "<br />" release += "<br />"
release += time.strftime("%F %R") release += time.strftime("%F %R")
version = release version = release
...@@ -55,11 +55,14 @@ exclude_patterns = ["output", "Thumbs.db", ".DS_Store", "hawkmoth"] ...@@ -55,11 +55,14 @@ exclude_patterns = ["output", "Thumbs.db", ".DS_Store", "hawkmoth"]
# - python-sphinx-rtd-theme package (on Debian) # - python-sphinx-rtd-theme package (on Debian)
try: try:
import sphinx_rtd_theme import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme" html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
pygments_style = "monokai" pygments_style = "monokai"
except ImportError: except ImportError:
logger.warning("The Sphinx \"sphinx_rtd_theme\" HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.") logger.warning(
'The Sphinx "sphinx_rtd_theme" HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.'
)
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
...@@ -68,9 +71,7 @@ except ImportError: ...@@ -68,9 +71,7 @@ except ImportError:
html_static_path = ["static"] html_static_path = ["static"]
# Theme Options # Theme Options
html_theme_options = { html_theme_options = {"style_external_links": True}
"style_external_links": True,
}
# Show "Edit on GitLab" links # Show "Edit on GitLab" links
html_show_sourcelink = False html_show_sourcelink = False
...@@ -86,12 +87,7 @@ html_context = { ...@@ -86,12 +87,7 @@ html_context = {
# }}} # }}}
# -- Options for Auto-Doc ---------------------------------------------------- {{{ # -- Options for Auto-Doc ---------------------------------------------------- {{{
autodoc_mock_imports = [ autodoc_mock_imports = ["sys_display", "ucollections", "urandom", "utime"]
"sys_display",
"ucollections",
"urandom",
"utime",
]
autodoc_member_order = "bysource" autodoc_member_order = "bysource"
# }}} # }}}
...@@ -101,6 +97,7 @@ has_hawkmoth = False ...@@ -101,6 +97,7 @@ has_hawkmoth = False
try: try:
# Attempt importing hawkmoth # Attempt importing hawkmoth
import hawkmoth # noqa: F401 import hawkmoth # noqa: F401
extensions.append("hawkmoth") extensions.append("hawkmoth")
cautodoc_root = os.path.abspath("..") cautodoc_root = os.path.abspath("..")
...@@ -108,7 +105,9 @@ try: ...@@ -108,7 +105,9 @@ try:
has_hawkmoth = True has_hawkmoth = True
except ImportError as e: except ImportError as e:
if e.name == "clang": if e.name == "clang":
logger.warning("hawkmoth requires the clang python module. Documentation for Epicardium API will not be generated.") logger.warning(
"hawkmoth requires the clang python module. Documentation for Epicardium API will not be generated."
)
# }}} # }}}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment