Back to Notenik Docs


The Notenik Knowledge Base

7.3.8 Intra-Note Commands ↑

7.3.8.3 Generate Outline Based on Headings

As an extension to the original Markdown spec from John Gruber, a Note’s body field can be formatted as an outline, using the Note’s embedded headings as the items in the outline.

This outline formatting is requested by placing the following command line in the body field, before the appearance of any headings.

{:outline-headings}

Headings can then be indicated using the usual Markdown syntax. However instead of formatting each heading line with the usual h1 through h6 tags, Notenik will make each heading a summary element, with the heading line and all following content – up to the next heading at the same level – enclosed within a details element.

The result will be that each heading line will start with a disclosure triangle, with the details following the heading line initially hidden. Clicking on the disclosure triangle will then reveal the details following the heading line (including any lower-level headings, which will in turn have their own disclosure triangles).

For example…

Styling with CSS

Each <details> tag will have a css class assigned, in the format heading-x-details, where x is the level of the heading (normally indicated by the number of hash marks used).

Similarly, each <summary> tag will have a css class assigned in the format heading-x-summary, where x is again the level of the heading.

Notenik will supply default styling for these classes in order to appropriately indent each level of the outline, but this default styling can be overridden by the user to modify the appearance of the headings.

Expanding the Initial Outline Display

If you wish the initial Note display to show multiple levels of headings, then place a colon and a single digit after the command itself. A value of 0 or 1 will just show the first level of headings – the same as the default, without any modifier. A value of ‘2’ will result in two levels of headings being initially visible, and so on.

For an example, see the following line:

{:outline-headings:3}
Heading Levels

Note that this command will work just as well no matter what heading levels you choose to use. In other words, you could start with a level 1, followed by a level 2 (levels indicated by numbers of hash marks), but you could also start with a level 2 (two hash marks) followed by level 4 headings (four hash marks).

OPML Conversion

OPML stands for “Outline Processor Markup Language,” and is a text-based format designed to store and exchange outlines with attributes. Most outlining applications (such as the Bike Outiner and OmniOutliner can save and/or export outlines in the OPML format.

If you drag such a file (with a file extension of .opml) from the Finder and drop it onto the List tab of an open Notenik Collection (positioning the drop before or after an existing Note, but not directly on it), then Notenik will convert the OPML file into a Notenik Note that starts with the {:outline-headings} command and has headings representing the outline items.


Next: 7.3.8.4 Generate a List of Attachments