/* Code Comments */

Named Anchors & Markdown

October 11, 2019

When writing longer files in Markdown, it can be useful to create links within the document to help readers navigate. This cross referencing makes jumping around the document even simpler.1

For example:

### <a id="my-header"></a> Header

…
And then later, I want to go to [Header](#my-header), you create a link, just like any other.

The reason we have to add the anchor tag to the Header is that the Markdown spec doesn’t automatically do it.2

Fortunately, many Markdown resolvers do, Gitlab, VSCode, Remark, etc.

If you’re using one of these to convert the Markdown to HTML, things are even simpler:3

### My Stupendous Header

…
And then later, I want to go to the [header](#my-stupendous-header), you create a link, just like any other.

Footnotes


Stephen Weiss

Thanks for reading! My name's Stephen Weiss. I live in Chicago with my wife, Kate, and dog, Finn.
Click here to see the archives of my weeks in review and sign up yourself!