summaryrefslogtreecommitdiffstats
path: root/docs/conf.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-02-21 20:28:12 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-02-21 21:04:50 +0400
commitfef4c75210fbf812279cc73457abe42bbe8fd983 (patch)
tree3882cedd54a89f9e1fef3f1ae1d35d5211da6c7f /docs/conf.py
parentMerge branch 'main' into port-utilities (diff)
Revert Breaking Doc Changes
A previous commit tried to utilize the default autodoc option configuration to make the doc generation more streamlined and organized, but they seem to not work well.
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/docs/conf.py b/docs/conf.py
index e2801e2c..23feab31 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -7,6 +7,7 @@ from pathlib import Path
import git
import tomli
+from sphinx.application import Sphinx
from docs import utils
@@ -87,6 +88,8 @@ html_js_files = [
"changelog.js",
]
+utils.cleanup()
+
def skip(*args) -> bool:
"""Things that should be skipped by the autodoc generation."""
@@ -100,6 +103,11 @@ def skip(*args) -> bool:
return would_skip
+def setup(app: Sphinx) -> None:
+ """Add extra hook-based autodoc configuration."""
+ app.connect("autodoc-skip-member", skip)
+
+
# -- Extension configuration -------------------------------------------------
# -- Options for todo extension ----------------------------------------------
@@ -131,16 +139,5 @@ intersphinx_mapping = {
}
-# -- Options for the autodoc extension ---------------------------------------
-utils.cleanup()
-autodoc_default_options = {
- "members": True,
- "special-members": True,
- "show-inheritance": True,
- "imported-members": False,
- "exclude-members": "__weakref__"
-}
-
-
# -- Options for the linkcode extension --------------------------------------
linkcode_resolve = functools.partial(utils.linkcode_resolve, SOURCE_FILE_LINK)