Markdown and Pandoc
Why Markdown?
I like Markdown because it is lightweight, simple, and readable. It has minimal requirements, can be edited by a simple editor (vim is enough) and it can be edited quickly. It is readable on any platform by any tool. It is ubiquitous, supported by Jekyll, Github Pages, and PHP. It is heavy in terms of information and small with a file size. Still it has also features of its heavier brothers like TeX, HTML and PDF.
It has its limitations though: Not such flexible as HTML is, comes in many flavors – most of them supporting only a limited set of features. There is Markdown of DaringFireball which is pretty raw, limited version. There are extensions of PHP, Python, and Pandoc.
It also has a strong competitor: Textile – which has similar features and comes much farther in a field of flexibility, allowing to specify CSS properties directly.
Pandoc
If not Pandoc I would not write this post. Truth is, recently I started to be sick of Markdown because of its all limitations. There were PHP and Python extensions but not easy to use. A few days ago I really needed to write a document and since there was no MS Word around, but only Linux available, I decided to give a go for Markdown. Truth is I find rather distracting to use sopthisticated tools just for a simple task.
As a first try I started searching some plugins for Chromium and Firefox. It
would be nice to write some text, cut-and-paste to browser and click a button to
make it a nice HTML. Indeed there is something like that for Firefox (Markdown
converter for Gmail) but I was not satisfied enough. In the next attempt I did
search through apt-cache
and that time found something promising: pandoc
. It
tempted me by its simplicity and a possiblity to convert, from and to, multiple
formats. Not just Markdown itself but plain text, epub, pdf, LaTeX, RTF, groff
and many others. Although this is Markdown which seems to be the central feature
of pandoc
. But what really captured me is wide spread of Markdown features.
The native Pandoc Markdown has quite nice implementation of Markdown
tables and lists – in my opinion the weakest point of raw Markdown. And this
is just what the top of the iceberg, there is much more added in comparision to
raw Markdown.
Pandoc has try me live page to get familiar with it and test its capabilities.
Ability to create pdf documents works through LateX module. So one need to install LateX on the system first before pandoc is able to create a pdf. For Ubuntu 16.04, required packages are:
texlive
texlive-lang-polish
texlive-latex-base
texlive-latex-recommended
texlive-xetex
Usage
Most of my Markdown documents are created on for my Jekyll blog. And Jekyll has
rather raw implementation of Markdown. I cannot change it as long as I want to
my blog live at Github Pages. So I did not experiment with other Jekyll extensions
for Markdown so far.
I used pandoc
once when preparing an independent document, not to be published
at my website and it did well. This is the way I am going to use it – have
formatted documents written in Pandoc Markdown implementation and then convert
them to HTML (usually) and possibily to PDF.
VIM
Table Mode
There is an awesome table creator: VIM Table Mode. I spent an hour playing with it. By installing it I found also a couple of other interesting plugins at github.
Markdown Syntax
To my surprise VIM does not support Markdown out of the box. At least it does not look nice. There are multiple extensions present at Github and I started with this one and I found it satifactory.
Summary
Pandoc has really nice implementation of Markdown. But it is useful only when working offline. Jekyll’s standard implementation is limited to Github’s implementation.