title: Zettelmarkup: Headings
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
back: 00001007010000 00001007030000 00001007040324 00001007721200 00001007800000 00001007906000 00001007990000
backward: 00001007010000 00001007030000 00001007040324 00001007721200 00001007800000 00001007906000 00001007990000
box-number: 1
copyright: (c) 2020-present by Detlef Stern <ds@zettelstore.de>
created: 20210126175322
forward: 00001007040000
lang: en
license: EUPL-1.2-or-later
modified: 20250102210039
published: 20250102210039
visibility: public

To specify a (sub-) section of a zettel, you should use the headings syntax: at
the beginning of a new line type at least three equal signs (&ldquo;`=`&rdquo;, U+003D), plus at least one
space and enter the text of the heading as [inline elements](00001007040000).

    === Level 1 Heading
    ==== Level 2 Heading
    ===== Level 3 Heading
    ====== Level 4 Heading
    ======= Level 5 Heading
    ======== Level 5 Heading

This renders in HTML as:



# Notes

The heading level is translated to an HTML heading by adding 1 to the level, e.g. `=== Level 1 Heading` translates to `<h2>Level 1 Heading</h2>`.
The `<h1>` tag is rendered for the zettel title.

This syntax is often used in a similar way in wiki implementation.
However, trailing equal signs are *not* removed, they are part of the heading text.

If you use command line tools, you can easily create a draft table of contents with the command:

    grep -h '^====* ' ZETTEL_ID.zettel