Deanacus

by Dean Harris

A Markdown Bookmarklet

For as long as I care to remember, everything I’ve written has been written in Markdown. It’s an incredibly simple to use formatting syntax that allows me to quickly and easily transform my words into one of many formats.

One thing I have always hated, though, is the process of creating links. I’ll often have the required links all open within browser tabs, but getting those URLs into my writing has always been more work than I feel it should be.

I’m also a long time fan of bookmarklets. These little snippets of javascript that are accessible from your bookmarks bar that allow you to interact with browser content in myriad ways have absolutely made my life easier.

It made sense to me to combine to two and solve my little linking problem. After a bit of searching, I really only found one good resource. Walter Higgins had written a couple of bookmarklets that did almost exactly what I wanted.

After trying to use Walter’s bookmarklets for a while, I realised that all I really wanted was a quick and easy way to get the URL and reference code in one go. I played around with what I’d found, and eventually came up with exactly what I wanted:

javascript:rc=prompt("Reference code:","");void(prompt("","["+rc+"]:%20"+location.href+""))

Prebuilt bookmarklet: Link Reference

After asking me for a reference code it returns the reference code and URL in exactly the format I need, ready to copy into my document. Simple, quick, painless.