When you write markdown files, headings automatically also get an ID generated so they become in-page targets to link to. This is also used to create a table of contents in various publishing systems.
This means
## Side effects of 24 hour compound V
becomes
<h2 id="side-effects-of-24-hour-compound-V">
Side effects of 24 hour compound V
</h2>
Today I learned that VS Code also offers these generated IDs as an autocomplete when you type links. If you wrap the word you want to link in square brackets and you add the parenthesis to type the target the link should point to starting this one with a # will offer all the possible target IDs in the current document.
Neat!
Top comments (0)