-
Notifications
You must be signed in to change notification settings - Fork 339
Content Code Snippets
Eric Eggert edited this page Jan 24, 2018
·
2 revisions
Note: Attributes in [
brackets]
are optional.
In a markdown file, the table of contents can be created automatically from the headings inside the document. The markdown will also automatically create IDs for the headings. The first line ({::options toc_levels="2,3" /}
) is optional and specifies the heading levels that will then be used in the unordered list in your document. 2,3
will pick up headings levels 2 and 3 (this is the default), just 2
will only pick up headings level 2.
{::options toc_levels="2,3" /}
{::nomarkdown}
{% include_cached toc.html type="start" title="Page Contents" %}
{:/}
- TOC is created automatically.
{:toc}
{::nomarkdown}
{% include_cached toc.html type="end" %}
{:/}
(Note: While it is possible to add a class
attribute to the first tag, it should not be used to keep TOCs uniform on all pages.)
Use the opening and closing tags from above and add your Page Contents list by hand between both tags.
{::nomarkdown}
{% include box.html type="start" title="Box title" [class] [icon] [h] %}
{:/}
Box content
{::nomarkdown}
{% include box.html type="end" %}
{:/}
-
[class]
– Pick one of the classes from the Components Library. -
[icon]
– Set an Icon. See full list of icons in the Components Library. -
[h]
– Optional heading level for the title. Use 1–6 to specify the appropriate heading level.