Writing in Markdown

I’ve taken the plunge. For the next month, I decided to do all my writing in Markdown, when practical, to see if it makes me more productive.

The learning curve isn’t that steep, however I do find myself constantly previewing my output as I learn the syntax. I found that part of my workflow frustrating and went looking for a solution.

A plethora of app choices

There are a number of great Markdown applications to choose from if you are a Mac users. One site has compared 35 of them and several provide live previews as you type. Lots of great options but for now I think I’ll stick with my text editor of choice on OS X.

Enter Marked

After searching around the web, I came across an application called Marked. It allows you to preview markdown output after you save your document. Each subsequent save results in Marked updating the preview. It has a number of additional features and you can try the application before you buy it! It has a ton of other features and supports most text editors.

The programmer behind Marked also has a TextMate bundle, which happens to be my text editor of choice on OS X, that provides a Preview in Marked option. Simply download the Marked Bonus Pack, unzip the archive then open the TextMate folder and double-click the Marked.tmbundle. You should see a dialog box, similar to the one below.

Marked bundle

Click the Install button and then restart TextMate.

Much better

My new markdown workflow is complete:

  1. Create a new document in TextMate (Command ⌘ + N)
  2. When you want to Save or Preview for the first time, use the following keyboard combination:

    Command ⌘ + Shift ⇧ + M

  3. Anytime I resave (Command ⌘ + S), Marked shows me the latest changes.

Redcarpet Error with OS X Mavericks

If you use Ruby and have upgraded to Mavericks, don’t forget to open xCode and install the recommend updates. Or install it if you haven’t already. Then open Terminal and type:

xcode-select --install

That is now I fixed the Redcarpet error documented below.

The Longer Version

After upgrading to the latest version of Apple’s OS X, Mavericks, I ran into a problem when I decided to try out Jekyl, which is a static website generator written in Ruby. There is a gem dependency for Redcarpet and it errored.

Fetching: redcarpet-2.3.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
    ERROR: Failed to build gem native extension.

    /Users/puck/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb
creating Makefile

make "DESTDIR="
compiling autolink.c
In file included from autolink.c:17:
buffer.h:23:20: error: stdint.h: No such file or directory
In file included from autolink.c:17:
buffer.h:41: error: expected specifier-qualifier-list before ‘uint8_t’
In file included from autolink.c:18:
autolink.h:31: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
autolink.h:35: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.h:39: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.h:43: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c:20:20: error: string.h: No such file or directory
autolink.c:21:20: error: stdlib.h: No such file or directory
autolink.c:22:19: error: stdio.h: No such file or directory
autolink.c:23:19: error: ctype.h: No such file or directory
autolink.c:30: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
autolink.c:52: error: expected ‘)’ before ‘*’ token
autolink.c:136: error: expected ‘)’ before ‘*’ token
autolink.c:165: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__www’:
autolink.c:172: error: ‘data’ undeclared (first use in this function)
autolink.c:172: error: (Each undeclared identifier is reported only once
autolink.c:172: error: for each function it appears in.)
autolink.c:175: warning: incompatible implicit declaration of built-in function ‘strlen’
autolink.c: At top level:
autolink.c:201: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__email’:
autolink.c:210: error: ‘uint8_t’ undeclared (first use in this function)
autolink.c:210: error: expected ‘;’ before ‘c’
autolink.c:212: error: ‘c’ undeclared (first use in this function)
autolink.c:215: warning: incompatible implicit declaration of built-in function ‘strchr’
autolink.c:225: error: expected ‘;’ before ‘c’
autolink.c:241: error: ‘data’ undeclared (first use in this function)
autolink.c: At top level:
autolink.c:256: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__url’:
autolink.c:263: error: ‘data’ undeclared (first use in this function)
autolink.c:272: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [autolink.o] Error 1

The first thing I did was to uninstall the gem and delete it after I received an error that it was not deleted.

gem uninstall redcarpet   

rm -rf /Users/puck/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/redcarpet-2

Then I turned to Stackoverflow to look for the solution, which I found quickly with the question: Installing redcarpet on Mavericks.

The steps I followed are at the beginning of this post.