From fef4c75210fbf812279cc73457abe42bbe8fd983 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Mon, 21 Feb 2022 20:28:12 +0400 Subject: 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. --- docs/conf.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'docs/conf.py') 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) -- cgit v1.2.3