Lazy Reference Links Make Markdown Even Easier

lazy

Don’t worry — you don’t need to touch this.

This one’s pretty nerdy, but if you use Markdown to write anything with links in it (web articles, e-mails and so on) then you’re going to love it. It lets you use “lazy” reference links in Markdown to keep your text nice and tidy, but it does it without the references. Reference links without references? What? Wait…

A reference link usually looks something like this:

This is a [link][cats] to a picture of a cat.

The rest of your article...

[cats] :http://www.lolcats.com

The idea is that you can Keep all the messy links at the end of your document with just a reference in the actual body. When you convert from Markdown to HTML, everything is moved into place. But Brett Terpstra’s Lazy Reference Links script makes it even easier. Instead of pausing to think up a good name for the reference link, you just use an asterisk:

This is a [link][*] to a picture of a cat.

The rest of your article...

[*] :http://www.lolcats.com

The links need to be kept underneath the paragraph they refer to, but that’s it. If you have more than one link, then the script will use them in order, which shouldn’t get too messy in a paragraph.

The Ruby script can be turned into an iOS System Service and then conjured with a keyboard shortcut, or you can set it to run automatically in your Markdown text editor before the main Markdown conversion.

This strikes me as a perfect feature for people writing short text in Markdown. If you’re working on a big feature, regular reference links are worth the extra effort as they are more robust during the editing process, but if all you;re doing is banging out a few paragraphs then Lazy Links are the way to go.

Related

About the author

Charlie Sorrel Charlie Sorrel is the Reviews Editor here on Cult of Mac. Follow Charlie  on Twitter at @mistercharlie.

(sorry, you need Javascript to see this e-mail address)| Read more posts by .

Posted in News | Tagged: , , , , |