Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show internal section headings in global TOC #86

Open
infinity0 opened this issue Dec 4, 2020 · 0 comments
Open

Don't show internal section headings in global TOC #86

infinity0 opened this issue Dec 4, 2020 · 0 comments

Comments

@infinity0
Copy link
Contributor

infinity0 commented Dec 4, 2020

Suppose I have a page like:

==========
Chapter A
==========

.. toctree::
   :hidden:
   :glob:
   :maxdepth: 1

   a/*

Intro
========

Introduction text

Terminology-wise I'll refer to Intro as an "internal" section heading as this is defined on the same page, and a/* as "external" section headings as they are defined on subpages.

Currently sphinx-material in the global TOC renders all the subsection headings a/* plus Intro directly below Chapter A in the tree, as per what the above syntax defines. In the local TOC however, this renders just Intro directly below Chapter A, i.e. only the internal section heading.

I would like to omit rendering Intro (i.e. the internal section heading) in the global TOC, and only render external section headings, however I couldn't figure out how to change globaltoc.html and localtoc.html to do this. Clearly there is some way of distinguishing the internal vs external section headings, could you please advise?

infinity0 added a commit to infinity0/sphinx-material that referenced this issue Dec 4, 2020
infinity0 added a commit to infinity0/sphinx-material that referenced this issue Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant