Heading IDs and links
All Markdown-rendered headings automatically get IDs that can be linked to, except in comments.
On hover, a link to those IDs becomes visible to make it easier to copy the link to the heading to use it somewhere else.
The IDs are generated from the content of the heading according to the following rules:
All text is converted to lowercase.
All non-word text (such as punctuation or HTML) is removed.
All spaces are converted to hyphens.
Two or more hyphens in a row are converted to one.
If a heading with the same ID has already been generated, a unique incrementing number is appended, starting at 1.
To create links to headings in Markdown, you first need to add an ID to the heading using the syntax # Heading {#id}. Then, you can link to that heading using Link Text.
You can link to headings in Markdown by using the link syntax. To do this, you need to add an id attribute to the heading. Here’s how:
## My Heading {#my-heading}
To link to this heading, use:
[Link to My Heading](#my-heading)
To link to a heading on another page, include the file name in the link:
[Link to About](about.md#my-heading)