Skip to content

Commit

Permalink
Excludes table-of-contents from main page
Browse files Browse the repository at this point in the history
- Removes the table of contents at the end of the main page since it is always
    visible in the side bar.
  • Loading branch information
pranavm-nvidia committed Jan 8, 2025
1 parent 2f88ae2 commit 96ffc9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tripy/docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- This template lets us hide the TOCs from the main page and only include them in the sidebars -->
{% block sidebartoc %}
<h3>{{ _('Table Of Contents') }}</h3>
{{ toctree(includehidden=True) }}
{% endblock %}
2 changes: 2 additions & 0 deletions tripy/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
# The master toctree document.
master_doc = "index"

templates_path = ["_templates"]

# General information about the project.
project = "Tripy"
copyright = "2024, NVIDIA"
Expand Down
4 changes: 3 additions & 1 deletion tripy/docs/generate_rsts.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def add_guide_set(guide_set):
dedent(
f"""
.. toctree::
:hidden:
:caption: {guide_set.title}
:maxdepth: 1
"""
Expand All @@ -152,6 +153,7 @@ def add_guide_set(guide_set):
dedent(
f"""
.. toctree::
:hidden:
:caption: API Reference
:maxdepth: 1
"""
Expand Down Expand Up @@ -309,7 +311,7 @@ def str_from_hierarchy(obj):

print(f"Generating documentation hierarchy:\n{str_from_hierarchy(doc_hierarcy)}")

EXCLUDE_DIRS = ["_static"]
EXCLUDE_DIRS = ["_static", "_templates"]

guide_sets: List[GuideSet] = []
guide_dirs = list(
Expand Down

0 comments on commit 96ffc9e

Please sign in to comment.