executablebooks / sphinx-external-toc

A sphinx extension that allows the site-map to be defined in a single YAML file
https://sphinx-external-toc.readthedocs.io
MIT License
33 stars 18 forks source link

Section Headings #43

Open lornajane opened 3 years ago

lornajane commented 3 years ago

Is your feature request related to a problem? Please describe.

I would love to be able to add plain text labels or section headings into my navigation. Right now I have "pointless" pages that just make the navigation folding for another section work. I'd appreciate a plain text option, for example we have a subsection "concepts" that holds too much stuff to have open by default but I have to have a "concepts" page that performs no actual purpose, it's just to make the navigation work.

Describe the solution you'd like

Have an option to have a plain text entry instead of a link. If it has children, it's collapsible. So like an entry that only has the title field to display, but doesn't link anywhere.

Describe alternatives you've considered

Going back to maintaining all those toctree entrires in all my files to get the section heading feature. Doing what I have now with a page that just displays the tables of contents or some sort of introduction to a navigation section.

If there are more alternatives, I'm happy to hear about possible workarounds

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 3 years ago

Thanks! To note, this came out of a discussion on Slack, so I understand the use case here and agree it would be a nice addition

trulede commented 3 years ago

I've encountered a similar thing:

---
root: intro.md
defaults:
  titlesonly: True
subtrees:
  - caption: Schemas
    titlesonly: False
    entries:
      - file: schemas/flatbuffers/__index__.md   <<<< This file does nothing, just wanted a grouping in the TOC
        subtrees:
          - entries:
              - glob: schemas/flatbuffers/*``    <<<< Content is here

Before I read the manual, I did think this might work:

---
root: intro.md
defaults:
  titlesonly: True
subtrees:
  - caption: Schemas
    titlesonly: False
    entries:
      - caption: Flatbuffers
        subtrees:
          - entries:
              - glob: schemas/flatbuffers/*
lornajane commented 1 year ago

I'm still struggling with this, which is regularly reported as a problem with our documentation. I can nearly do this by making every level of nesting into a subtree, and adding a caption for the subtree. This looks all right in the .. tableofcontents output, but seems to be ignored by the left-hand navigation itself. I know a bunch of people have run into this so just sharing my findings as I go along, in case it helps anyone!