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

Support for directive :toc:, to embed a page table of contents #801

Open
BurdetteLamar opened this issue Mar 23, 2021 · 0 comments
Open

Comments

@BurdetteLamar
Copy link
Member

(@kou suggested this feature request.)

An embedded directive :toc: is replaced by the table of contents (TOC) derived from the down-page headers:

  • If the headers are well-formed (see below), the TOC is structured as nested lists; if not, the TOC is a single flat list.
  • Each TOC entry is a link to its corresponding header; the text for the link is the text from the header.
  • Headers preceding the :toc: directive are not included in the TOC.

The headers are well-formed if:

  • The first-found header is as high-level as any headers that follow it. E.g., if the first-found header is level 2, there are no following level-1 headers (but there may be additional level-2 headers).
  • There are no level "jumps". E.g., a level-2 header followed by a level-4 header.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant