Simple settings for writing and converting markdown with Sublime Text
Prettify your markdown
There are dedicated markdown packages, but if you write in Sublime, here are some very simple tweaks you can make to get a lovely centered column, in the width of your choosing with spell checking enabled.
Open a markdown (*.md) file, and go ‘Settings > Settings – Syntax Specific’ and you will be presented with a dual file panel with and empty JSON on one side. Here is what I add to mine:
// These settings override both User and Default settings for the Markdown syntax
{
"wrap_width": 80,
"draw_centered": true,
"spell_check": true,
},
Hopefully they are all pretty self explanatory – with those in place you get a nice centered layout that wraps at 80 columns (amend width to suit) with spell check enabled.
Converting your markup
Again, there are dedicated packages to simplify converting your markdown with Pandoc. However, if you want something mean and lean, you can make yourself a simple build script.
Assuming you have Pandoc installed, from the Sublime menu, Tools > Build System > New Build System.
You’ll be greeted with a blank JSON file, add the following:
{
"shell_cmd": "pandoc \"${file}\" --no-highlight --wrap=none | pbcopy",
"working_dir": "${file_path}",
"selector": "text.html.markdown"
}
Now, when you have written your markdown file, and want it converting, you can just use cmd+b
to ‘build’ it and get the file converted and copied to your clipboard.
You may well want to tweak the pandoc command to your preference but it should be whatever you would use on the command line to run Pandoc. The only point of note is that you will need the \"${file}\"
part in there. That is what tells the build system to use the contents of the file you are working on as the file that gets sent to the command.
What font are you using in Sublime? I like it.