From 8362b69e2892ce9cb1241abc20ecac0836819102 Mon Sep 17 00:00:00 2001 From: Alexander Hampel Date: Wed, 16 Feb 2022 14:49:35 -0500 Subject: [PATCH] properly load module and add toctree for class generation --- doc/CMakeLists.txt | 2 +- doc/_templates/autosummary_class_template.rst | 9 +++------ doc/conf.py.in | 2 +- doc/documentation.rst | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 04d1ad06..6578595a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -56,7 +56,7 @@ endif() add_custom_target(${PROJECT_NAME}_docs_sphinx ALL) add_custom_command( TARGET ${PROJECT_NAME}_docs_sphinx - COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python/${PROJECT_NAME}:${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -c . -b html ${CMAKE_CURRENT_SOURCE_DIR} html + COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -j auto -c . -b html ${CMAKE_CURRENT_SOURCE_DIR} html ) option(Sphinx_Only "When building the documentation, skip the Python Modules and the generation of C++ Api and example outputs" OFF) diff --git a/doc/_templates/autosummary_class_template.rst b/doc/_templates/autosummary_class_template.rst index e74d21b5..49fc6786 100644 --- a/doc/_templates/autosummary_class_template.rst +++ b/doc/_templates/autosummary_class_template.rst @@ -1,19 +1,15 @@ -{{ fullname | escape | underline}} +{{ fullname | escape | underline }} .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} - :members: - :show-inheritance: - :inherited-members: {% block methods %} -.. automethod:: __init__ - {% if methods %} .. rubric:: {{ _('Methods') }} .. autosummary:: + :toctree: {% for item in methods %} ~{{ name }}.{{ item }} {%- endfor %} @@ -25,6 +21,7 @@ .. rubric:: {{ _('Attributes') }} .. autosummary:: + :toctree: {% for item in attributes %} ~{{ name }}.{{ item }} {%- endfor %} diff --git a/doc/conf.py.in b/doc/conf.py.in index 230762e6..ff4697b1 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -73,7 +73,7 @@ html_theme_options = { # Toc options 'collapse_navigation': False, 'sticky_navigation': True, - 'navigation_depth': 4, + 'navigation_depth': 5, 'includehidden': True, 'titles_only': False } diff --git a/doc/documentation.rst b/doc/documentation.rst index c82a0b5b..277034fe 100644 --- a/doc/documentation.rst +++ b/doc/documentation.rst @@ -26,4 +26,4 @@ Python reference manual :template: autosummary_module_template.rst :recursive: - app4triqs_module + app4triqs