diff --git a/docs/src/conf.py b/docs/src/conf.py index 0af6ec072f3..4e292513058 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -167,11 +167,13 @@ def _dotv(version): if skip_api == "1": autolog("Skipping the API docs generation (SKIP_API=1)") -else: - # better api documentation (custom) - extensions.extend( - ["custom_class_autodoc", "custom_data_autodoc", "generate_package_rst"] - ) +# else: +# better api documentation (custom) +# extensions.extend( +# ["custom_class_autodoc", "custom_data_autodoc", "generate_package_rst"] +# ) + +# extensions.extend("sphinxcontrib.apidoc") # -- panels extension --------------------------------------------------------- # See https://sphinx-panels.readthedocs.io/en/latest/ @@ -223,6 +225,24 @@ def _dotv(version): autoclass_content = "init" modindex_common_prefix = ["iris"] + +# TREMTEST START +source_code_root = (Path(__file__).parents[2]).absolute() +autolog(source_code_root) +sys.path.append(str(source_code_root)) + +# -- apidoc extension --------------------------------------------------------- +# See https://github.com/sphinx-contrib/apidoc +module_dir = source_code_root / "docs/src" + +apidoc_module_dir = str(module_dir) +apidoc_output_dir = str(Path(__file__).parent / "___generated") +apidoc_excluded_paths = [str(module_dir / "tests")] +apidoc_separate_modules = True +apidoc_extra_args = ["-H", "API"] +# TREMTEST END + + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"]