Lee Byron

tilmarkdown link references

Inline markdown links and images can be hard to read with long URLs. References are a great way to keep prose readable and keep a catalog of links. There are quite a few variations of the syntax.

Write references with a box around the reference identifier followed by a colon and the URL, optionally include a trailing title in quotes (which may go on the following line):

[links]: https://spec.commonmark.org/0.30/#links
[links]: https://spec.commonmark.org/0.30/#links 'Nearly a hundred tests'

Then within prose, refer to them with typical link syntax, but with a trailing box instead of parentheses. If the linked text is the same as the identifier, just use a standalone box.

Here is a link about [markdown links][links]. What's the web without [links]?

Here is a link about markdown links. What’s the web without links?

References can appear anywhere in a Markdown file. I often place them right after the paragraph where they’re used. If they’re used in multiple places, I’ll group them together at the end of a section or end of the whole document.

References can also be used for images. The syntax for the reference is the same, but the image use itself starts with an !.


[moebius]: https://uploads4.wikiart.org/images/m-c-escher/bond-of-union.jpg
'Bond of Union, M.C. Escher 1956'