Markdown syntax: Headings
Headings are lines starting with 1 to 6 hashes #.
Examples
# First level
## Second level
### Third level
#### Fourth level
##### Fifth level
###### Sixth level
The trailing hash characters, if present, are omitted.
Alternatively first and second level headings can also be in Setext style: underlined with any number of equal signs = for first levels and dashes - for second levels.
Examples
First level
===========
Second level
------------
Anchors
Anchors are automatically created from headings.
Notes
- Non-alphanumeric characters are discarded but hyphens - or underscores _.
- Spaces are replaced by hyphens -.
Examples
Heading |
Anchor |
# Text-only Heading |
#text-only-heading |
# Non alpha & num |
#non-alpha--num |
# 📦 Start with emoji |
#-start-with-emoji |
# Several spaces |
#Several---spaces |
# Underscore_ |
#underscore_ |
# Emphasized **heading** |
#emphasized-heading |
## With `code` span |
#with-code-span |
Tip
If the document will be translated into another language, it's a good idea to add a non-localized anchor.
Example
# Translated title {#not-localized-anchor}