I’ve recently started doing a lot of writing in Markdown: I’ve been taking notes on my iPad in Byword and syncing them through Dropbox so I could open them in Sublime Text on my Mac and Windows computers. And, at least for now, I’ve settled on pandoc as my markdown renderer of choice.

I was using the SublimePandoc plugin for a week or two when I realized that SmartMarkdown had built-in support for SublimePandoc: so there was no reason to duplicate the plugins (this also explains why my command menu had all of those pandoc duplicates…). Also, SublimePandoc hard-codes its html template in its package directory (so using a different template means changing the plugin package) and SmartMarkdown actually uses the template from your regular pandoc data directory. Huzzah. (Of course, I ended up having to edit the SmartMarkdown package directory anyway, but I’m assuming this is a bug that will be fixed one day and not a deliberate design choice.)

So tonight I wanted to dump SublimePandoc and just use SmartMarkdown. I had to fiddle a bit to make it work on my Mac, unfortunately, so I want to document those steps here in case I ever need to do it again.

The biggest problem is that I would get the error "[Errno 2] No such file or directory" whenever I’d try to use SmartMarkdown’s pandoc renderer. It took me a while to track this down (using printf debugging of the plugin: yay Python!) but this error resulted because the plugin couldn’t see my pandoc binary. I don’t really understand this because pandoc is clearly in my path (and I can run it freely from the commandline).

Unfortunately, SmartMarkdown does not currently support setting the pandoc path as a configuration option, so I just hardcoded it in the plugin (yay Python!). I used the terminal command

where pandoc

to find the full path of my pandoc binary and then opened up pandoc_render.py (in $SUBLIME_PACKAGES_DIRECTORY$/SmartMarkdown) and found the run_pandoc method. I changed the line

cmd = ['pandoc'] + args

to

cmd = ['/usr/local/bin/pandoc'] + args

which saved me from that error.

And in my user settings file for SmartMarkdown, I had to add the key

"pandoc_args": ["--standalone"]

to convince pandoc to actually use my template. After that, everything is peachy.

For completeness sake, my full settings for SmartMarkdown and my keyboard shortcuts are:

SmartMarkdown Users Setting File

{
    /* Please specify the PATH of pdflatex if you wanna generate PDF */
    "tex_path": ["/usr/texbin",
                 "/usr/texbin"],
    /* Provide your arguments here as a list e.g.: ["--latex-engine=xelatex", "--toc"]
    arguments that are separated by space must be in separate slots. e.g. ["-H", "template.tex"] */
    "pandoc_args": ["--standalone"],
    "pandoc_args_pdf": [],
    "pandoc_args_html": [],
    "pandoc_args_docx": []
}

User Keyboard Setting (Snippet)

{
    "keys": ["super+shift+m"],
    "command": "pandoc_render",
    "args": {"open_after": true, "target": "html", "save_result": false}
}
Wednesday, March 27th, 2013
Link: Get A Job, Sir!

Shaman's Crossing (Soldier Son, #1)Shaman’s Crossing by Robin Hobb
My rating: 3 of 5 stars

This book is problematic for me. I feel like I should love it. On paper, this book has everything I want in a novel.

* Novel fantasy setting? Check!
* Novel magic system? Check!
* Compelling political situations? Check!
* Likable main character? Check!
* Likable supporting characters? Check!
* Well-written by one of my favorite fantasy authors? Check and check!

And on and on. There’s no reason for me to not love this book. And, indeed I devoured the first third of it. And then my reading pace sort of fell off a cliff and it took me three months to actually finish the thing. And as I’ve been reading it (or not reading it, I guess), I’ve given some thought to the question: “Why?” I wondered. “What’s falling flat?”.

And I finally figured it out: the plot of this book is driven by really unfair things happening to the main character. His entire life is basically his being shoved from one unfortunate situation to another where people with power are screwing with him for his own purposes.

And you know what? That’s fine. That’s basically how life is, right? It’s perfectly acceptable, no it’s perfectly *good* for a book to have the verisimilitude of life being awful. Because life *is* awful and literature, at its best, (especially SF/F literature) paints a picture of the world as it is.

But me? I like escapism. Life *is* awful and I don’t need more of it when I sit down to read. So I like my books to have a bit more justice in them.

This undoubtedly says more about me than it does about the book which, as I note, was well-written and has many compelling attributes. And I’ve already bought the next two books in the series and will absolutely be reading them.

Slowly.

Monday, March 18th, 2013
Quote: Alex Limi
Design by committee often looks like a row of checkboxes.
Hat Tip: Hacker News