Notenik Knowledge Base

Back to

9.2 Notenik Markdown Parser ↑

9.2.17 Generate a Collection Table of Contents

As an extension to the original Markdown spec from John Gruber, a Table of Contents may be generated for an entire Collection.

This feature may be invoked with a line like the following:


If the Collection has a Level field, then the contents of the level field will be used to control indentation and the nesting of lists, so that the table of contents will appear in an indented outline format.

The generated Table of Contents will support direct linking from any ToC entry to the represented Note itself.

See this Collection’s Complete Table of Contents for an example.

With options similar to those available to generate a Note Table of Contents, this command may be followed by one or two digits to indicate, respectively, the lowest level to be included in the ToC, and the highest level.

The Note in which the ToC appears will not itself be included in the generated Table.

Note that, when using Merge Templates and converting Markdown to HTML, you will likely also need to use the Variable Modifier identified as the Wiki-Style Links Mod, typically with a value of ‘w1’, in order to make sure that this command resolves effectively, since it generates wiki-style links in Markdown before the conversion to HTML takes place.

Next: Generate a Collection Index