From f2936f2d077758af26df2810137f25b3a1a5ffc2 Mon Sep 17 00:00:00 2001 From: Abrar Rahman Protyasha Date: Fri, 23 Jul 2021 14:54:24 -0400 Subject: [PATCH 1/2] Add library API to the toctree This commit fixes a warning about the library API document not being included in the document, and also fixes the API sidebar rendering. These two issues are connected because the Sphinx html theme uses the `:toctree:` directive to create the sidebar. References: * Exhale, link to generated documentation API: https://exhale.readthedocs.io/en/latest/usage.html#make-your-documentation-link-to-the-generated-api * Sphinx rtd theme, table of content options: https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#table-of-contents-options Signed-off-by: Abrar Rahman Protyasha --- rosdoc2/verbs/build/builders/sphinx_builder.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/rosdoc2/verbs/build/builders/sphinx_builder.py b/rosdoc2/verbs/build/builders/sphinx_builder.py index c3b82b8..ac4fe4d 100644 --- a/rosdoc2/verbs/build/builders/sphinx_builder.py +++ b/rosdoc2/verbs/build/builders/sphinx_builder.py @@ -170,6 +170,15 @@ def ensure_global(name, default): ## without the rosdoc2 tool. html_theme = 'sphinx_rtd_theme' +html_theme_options = {{ + # Toc options + 'collapse_navigation': False, + 'sticky_navigation': True, + 'navigation_depth': -1, + 'includehidden': True, + 'titles_only': False, +}} + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". @@ -216,9 +225,13 @@ def ensure_global(name, default): C++ API ======= -:doc:`api/library_root` +.. toctree:: + :maxdepth: 2 -.. doxygenindex:: + README + api/library_root + Full API + File structure Indices and Search ================== From 5f82cbcadabe96cfb57b70a75c43e4b68db8aa07 Mon Sep 17 00:00:00 2001 From: Abrar Rahman Protyasha Date: Fri, 23 Jul 2021 15:35:52 -0400 Subject: [PATCH 2/2] Removing `README` listing from the index `toctree` This change allows us to relax the assumption that every package contains a README file. A possible TODO could be to add configuration options to enable something like this. Signed-off-by: Abrar Rahman Protyasha --- rosdoc2/verbs/build/builders/sphinx_builder.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rosdoc2/verbs/build/builders/sphinx_builder.py b/rosdoc2/verbs/build/builders/sphinx_builder.py index ac4fe4d..4e6a52d 100644 --- a/rosdoc2/verbs/build/builders/sphinx_builder.py +++ b/rosdoc2/verbs/build/builders/sphinx_builder.py @@ -228,7 +228,6 @@ def ensure_global(name, default): .. toctree:: :maxdepth: 2 - README api/library_root Full API File structure