March 28, 2013, [MD]
I've been writing more blog posts than usual lately, because of the Beyond the PDF2 conference, as well as some hacks I've been working on, and I realized (again) how much of my time is taken up with finding and inserting links. I often have quite a lot of links in my blog posts, the graph shows a bunch of posts with only two or three links, but most have more than 10, and a few have up to 40 or 60 links (these two are the winners, with 78 links each).
Typically what I do is Cmd+T for a new tab, type in a Google query, select the new page, Cmd+L and Cmd+C to copy the URL, back to the blog editor, insert link, etc. It's quite quick, but for 10, 20 or 40 links, it takes a significant of time, and also disrupts the writing.
When you use the UI to add a link in WordPress, it automatically suggests other blog posts, either by recency or by a search term. This is great, but it only looks at blog posts - what if I want to link to my YouTube video, or a wiki page? I'm also trying to (slowly) move away from WordPress onto a static site generator, probably nanoc, which relies on editing MarkDown.
As I was looking into accessing the Google Chrome history for some quantified self experiments, I realized that almost all the pages I link to are either pages I've recently accessed in Google Chrome, or my own pages, either from my blog, my wiki, or my YouTube, Vimeo or Slideshare channels. What if I could quickly search those sources, and have the resulting link inserted in MarkDown format? See the result in the short (2:30min) screencast below:
The script is triggered by Keyboard Maestro, grabs the currently selected text, and looks up in a bunch of data sources (some, like the YouTube, Vimeo and Slideshare channels are cached using the relevant APIs, others like the Google Chrome history, and my wiki pages, are live), and presents the choices using Pashua. If I make a choice, it then formats the link accurately depending on which application I am using, and in Google Chrome, the URL of the tab I am on (wiki markup for my wiki, Markdown on GitHub, etc).
The source is on GitHub, and it should be fairly easy to get running, especially if you only want Google Chrome history. There might be some individual quirks in how I access my wiki pages for example, but feel free to contact me if you have questions.
Stian PS: The other thing I spend a lot of time doing, is selecting, resizing, uploading and inserting pictures, and that's another thing I hope to simplify when I move to writing my blog posts in Markdown.
Stian HĂ„klev March 28, 2013 Toronto, Canada comments powered by Disqus