diff --git a/doc/_templates/autoapi/package.rst b/doc/_templates/autoapi/package.rst new file mode 100644 index 000000000..9cc9fbdc6 --- /dev/null +++ b/doc/_templates/autoapi/package.rst @@ -0,0 +1,14 @@ +.. # Template created by Patrick Lehmann + +Python Class Reference +###################### + +Reference of all packages and modules: + +.. automodule:: {{ node.name }} + +.. toctree:: + :maxdepth: 1 +{% for item in subnodes %} + {{ item.name }} +{%- endfor %} diff --git a/doc/conf.py b/doc/conf.py index 1ad5e4bd5..a537f66fa 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -276,8 +276,16 @@ # ============================================================================== autoapi_modules = { "pyVHDLParser": { -# "template": "module", + "template": "package", "output": "pyVHDLParser", "override": True } } + +for directory in [mod for mod in Path("../pyVHDLParser").iterdir() if mod.is_dir() and mod.name != "__pycache__"]: + print(f"Adding module rule for '{project}.{directory.name}'") + autoapi_modules[f"{project}.{directory.name}"] = { + "template": "module", + "output": "pyVHDLParser", + "override": True + } diff --git a/doc/index.rst b/doc/index.rst index 859524093..851fbab1a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -254,7 +254,7 @@ This library is licensed under **Apache License 2.0**. :caption: References :hidden: - pyVHDLParser/index + pyVHDLParser/pyVHDLParser References/index .. raw:: latex diff --git a/doc/pyVHDLParser/index.rst b/doc/pyVHDLParser/index.rst deleted file mode 100644 index d5a9143ec..000000000 --- a/doc/pyVHDLParser/index.rst +++ /dev/null @@ -1,8 +0,0 @@ -Python Class Reference -###################### - -Reference of all packages and modules: - -.. toctree:: - - pyVHDLParser