Markdown Service Tools

Recently, I’ve switched my billing workflow in the day job over to markdown. As a result of the way I’m jumping between platforms, I’m not always getting proper markdown line breaks. (to force a <br> code in markdown, you need to insert three spaces before hitting return.)

So I wrote my friend Brett Terpstra yesterday lamenting this hitch in my giddyup and Brett wrote back in ten minutes explaining: 1. This is solvable with a service; 2. He already solved it. Today you can download it with the latest update to Brett’s Markdown Services. These are so ridiculously useful. I ♥ Brett.

Data Liberation, MultiMarkdown, and OPML

Fletcher Penney has been hard at work on MultiMarkdown 3.0. Perhaps one of the most inspired new features is the ability to work with OPML files. (Don’t know what OPML is? Read this.) Fletcher let me in on the secret early and it is absolutely nerd-tastic.

The Revolution

We are on the verge of something remarkable with our data. Simple data portability is here and it is killing the stranglehold of any one software developer over our digital toolbelts. This option-rich environment is letting people build their own workflows. For a change, the machines are working for us. How did we get here? I see a few reasons:

The Mobile Explosion

With the iPhone, iPad, and App store, Apple has turned the world of mobile computing on its head. Every step of the way, competitors laughed, then feared, then copied. People are digging these new multiple devices and, as a result, there are a lot of operating systems to play in.

Multiple Operating Systems

The whole Mac vs. PC thing arises from one dimension, desktop computing. Those days are over. There are now more operating systems than ever and people are no longer working in just one. I currently use three daily (four if you count the Web). Once the Tablet-aganza gets in full swing there will be even more options. People need to move their data between these operating systems. The text, markdown, and OPML standards are the foot soldiers used by every app to make this happen.

Home-Brew Apps, Inc.

An App stores supporting these new platforms create historical opportunities for small developers . Size doesn’t matter if you have a good idea and execute on it. These little guys are competing where only multi-million dollar companies dared a few years ago. The result is a rich environment of options where ten people can have their favorite App in any category and they are all different.

Cloud Sync

We finally have a way to easily sync files between computers, operating systems, and platforms. There is a reason everyone gets misty eyed when we talk about Dropbox: we remember how hard it used to be to sync. Now that syncing is easy, the data needs to work everywhere.

Just the Beginning

Us nerds are just figuring this all out. Things are only going to get easier and this speaks well for our future computing experiences. No longer will we all need to bend our habits to the foibles of a few applications. Instead we are going to pick the apps that work the way we think and move our data between them without a second thought. I can’t wait.

TextExpander Markdown Snippets and Beyond

Brett is getting it together. His markdown snippets are more elegant than mine, which feel like the coding equivalent of Soviet-era public housing. Either way, I’m going to start pestering Brett to help out with this project and if you are a TextExpander/Markdown junkie, you should too.

This whole explosion of useful snippets resurrects an idea we kicked around at Macworld 2010. Why don’t we make a centralized depository for snippet bundles? There are a lot of nerds out there making some pretty fantastic snippets. Perhaps it is time we started sharing.

The Markdown Snowball

There is suddenly influx of Markdown and MultiMarkdown friendly apps on the iPad. While Markdown has provided an easy way to write for the web for years, the arrival of iOS devices and the need for portable text documents with retained formatting creates a perfect storm for widespread adoption of Markdown and MultiMarkdown for this purpose.

iOS developers have jumped on board with several interesting apps including MarkdownMail, Edito, and Elements. There are more. I’m still looking at these apps and making my own decisions about which ones I will incorporate into my workflows. This morning, I discovered a new contender, Trunk Notes (via Practically Efficient and Steven Frank) that allows you to create a Wiki synchronized through your Dropbox account (in an upcoming update) all for $1 (Through Monday). I waxed poetic about Markdown and MultiMarkdown in the upcoming Mac Power Users episode that will release this weekend. We even talked MultiMarkdown author Fletcher Penney to join us for a bit. Stay tuned.

Using TextExpander for Markdown Reference Links

Patrick Rhone (from MinimalMac) did his first screencast this week about creating a Text Expander snippet for Markdown links. Like Patrick, I write everything in Markdown (although I use the MultiMarkdown
variant), which lets me export to nearly any format and write on the iPhone, iPad, and Mac without friction. I wrote the whole book in MultiMarkdown.*

Anyway, Patrick’s video got me thinking. Patrick puts his links right next to the linked words. I use Markdown’s reference links. The advantage of using referenced links is that the text is much easier to read. You can also use the same reference more than once. Reference links can be set anywhere in the document. Some folks do it at the end of the paragraph. I do them all at the bottom.

The syntax for reference links in Markdown works as follows:

First you type some [Link Text][Reference]
Then more text … yadda yadda yadda
[Reference]:Web URL

The Link Text is the text that shows up on the page. The Reference is an index. It can be a number or words. The Web URL is the link you are pointing toward. Here is concrete example.

This is one [nerdy Mac site.][1]
Really, the guy just won’t shut up.
[1]:https://www.macsparky.com/

So I decided to take a page from Patrick’s playbook and create my own TextExpander snippet to create referenced links. It’s not that hard.

Snippet Walkthrough

If you are thinking ahead while you write, you can do this all in one step. This snippet, upon activation, asks you to insert the Link Text and Reference and then creates a Reference entry on the next line using the Web link from your clipboard. Finally, it puts the cursor back at the end of your link text. Fire up TextExpander and follow along.

Create a new snippet and start with two sets of brackets. The first will hold the Link Text and the second will hold the Reference. The Snippet should now look like this:

— Begin Snippet Code —
[][]
— End Snippet Code —

Next, create a Fill-In blank for the Link Text. These are blanks that Text Expander will prompt you to fill when the snippet runs. To create a Fill-In blank, insert the cursor between the first two brackets and select Fill-In from the Cursor drop down shown below.

— Begin Snippet Code —
[%fill:name%][]
— End Snippet Code —

Next, create a second Fill-In blank in the second set of brackets. This will be the blank for the Reference. When you create this second FIll-In blank, change the text from fill:name to fill:reference. This name is a variable. If you use the same name twice, TextExpander will copy it into both places. You will use this later.

— Begin Snippet Code —
[%fill:name%][%fill:reference%]
— End Snippet Code —

Next you’ll create the reference. First add a few carriage returns and then create the reference syntax, which is a pair of brackets and a colon.

    — Begin Snippet Code —
[%fill:name%][%fill:reference%]
[]:
— End Snippet Code —

Add a Fill-In blank in the brackets and rename it fill:reference. This duplicates the reference used above so you only need to type it once.

— Begin Snippet Code —
[%fill:name%][%fill:reference%]
[%fill:reference%]:
— End Snippet Code —

Next, add the Web URL. Place the cursor after the colon and select the Clipboard option from the cursor drop down shown in the figure below. This step dumps your clipboard in as a link. In order to make this work, you must first select and copy the link you want to use before activating the snippet. (You can do this in Safari by navigating to the desired page, pressing Command-L and then Command-C.) Alternatively, you could also make this a Fill-In field and type the URL in manually.

— Begin Snippet Code —
[%fill:name%][%fill:reference%]
[%fill:reference%]:%clipboard
— End Snippet Code —

Finally, move the cursor back to the top line at the end of the link and select Position Cursor Here from the Cursor menu. This resets the cursor back in your text so you can continue typing.

— Begin Snippet Code —
[%fill:name%][%fill:reference%] %|
[%fill:reference%]:%clipboard
— End Snippet Code —

I named this snippet Markdown Link and use the keyboard combination .[ to set it off.

Here is a picture of it in action.

And here is the resulting code.

Link as Afterthought

The above workflow assumes you think of creating the link while you are typing. If you want to add a reference link later, I created two more snippets.

The first takes highlighted text in the body of your text and sets up the text and reference number. Here is the TextExpander snippet code. I use .] to activate this snippet.

— Begin Snippet Code —
[%clipboard][%fill:reference%]
— End Snippet Code —

The second snippet creates the reference link. I use .: for this one.

— Begin Snippet Code —
[%fill:reference%]:%clipboard
— End Snippet Code —

Are you a Markdown nerd and using TextExpander? Let me know or, better yet, leave a comment and describe it for everyone.