I am writing a large Markdown document and would like to place a table of contents of sorts at the beginning that will provide links to various locations in the document. How can I do this?
I tried using:
[a link](# MyTitle)
where MyTitle
is a title within the document but this didn't work.
Best Answer
Github automatically parses anchor tags out of your headers. So you can do the following:
In the above case, the
Foo
header has generated an anchor tag with the namefoo
Note: just one
#
for all heading sizes, no space between#
and anchor name, anchor tag names must be lowercase, and delimited by dashes if multi-word.Update
Works out of the box with
pandoc
too.