Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #1800
It introduces a new
toc
directive that, for site builds, is transformed into a list-based table of contents. You may specifycontext
to switch between project, page, and section contents. The default context is project.project
- for this context, entries in the table of contents are all project pages and folders. You may also usetoctree
as an alias for the directive. (This provides partial functionality similar to the sphinx toctree directive, although that directive allows you to define child pages and their order. The MyST toc directive is only for display and entirely dependent on the toc structure defined in themyst.yml
file. See sphinx toctree here: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree)The following are all equivalent
page
- for this context, entries in the table of contents are all the headings on a page.section
- for this context, entries in the table of contents are only the headings of the current section you are in (sections are delimited by headings of the same depth). You may also usecontents
as an alias for toc directive with section context, to provide functionality similar to the docutils contents directive: https://docutils.sourceforge.io/0.4/docs/ref/rst/directives.html#table-of-contents)The following are all equivalent
You may also provide a heading for your table of contents:
Currently
toc
directives are ignored by PDF and other non-site build targets.