3.4. File syntax
3.4.5. Headers
3.4.4. Code spans
« Previous
3.4.6. Links
Next »

3.4.5. Headers

Markdown supports two header systems: Setext and atx. Like paragraphs, they are block elements, which means that they must be separated with at least one empty line from other elements of the same type.

Setext notation

Here, the headers are "optically" underlined with equality characters = (first level) or pauses - (second level).

Header 1
========

Header 2
--------

The number of underline characters has no matter.

atx notation

This method supports all the header levels, using one to six hash symbols # before the header text.

# Header 1

## Header 2

##### Header 5

The text may be optionally ended with the same characters to make the header look better. The number of the characters does not have to match the header level.

# Header 1 #

## Header 2 ####

##### Header 5 #

TypeFriendly makes a small change to the original parser. The header level is always decreased by 1, because the first level is reserved for the chapter title. So, the header written as the first level will be the second level and so on. As a result, TypeFriendly supports up to 5 levels, not 6.


Sample headers:

Header 1

Header 2

Header 3

Header 4
Header 5

3.4.5. Headers
3.4. File syntax
« Previous
3.4.4. Code spans
Next »
3.4.6. Links