Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr1832 :: Simplify writing using markdown and pandoc

How I use Markdown and Pandoc in my writing workflow

<< First, < Previous, Latest >>

Host Image
Hosted by b-yeezi on 2015-08-11 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (3)

Show Notes

I write almost exclusively in Markdown http://daringfireball.net/projects/markdown when writing documents and taking notes. I use the program, Pandoc http://www.pandoc.org to convert markdown to different formats, including odt, docx, and pdf.

The original purpose of Markdown: 1 > Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Markdown has since been extended to include more features and functionality. Extended versions include Github-flavored markdown https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet and multi-markdown http://fletcherpenney.net/multimarkdown.

Some of the basic syntax:

  • Headings - use one or more # to make headings
  • bold - use __ or ** for bold
  • italics - use _ or * for italics
  • hyperlinks - use [text](link) for hyperlinks
  • images - `alternative text for images
  • tables - Head1 | Head2 | Head3 ---- | ------ | ----- stuff | stuff | stuff
  • lists - use - or * or + at the beginning of a line
  • quotes and code - ` for single code item, > for block quote, tab for block code, ``` for fenced code. Highlighting is available

Pandoc: 2 Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, TWiki markup, OPML, Emacs Org-Mode, Txt2Tags, Microsoft Word docx, EPUB, or Haddock markup to

  • HTML formats: XHTML, HTML5, and HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides.
  • Word processor formats: Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML
  • Ebooks: EPUB version 2 or 3, FictionBook2
  • Documentation formats: DocBook, GNU TexInfo, Groff man pages, Haddock markup
  • Page layout formats: InDesign ICML
  • Outline formats: OPML
  • TeX formats: LaTeX, ConTeXt, LaTeX Beamer slides
  • PDF via LaTeX
  • Lightweight markup formats: Markdown (including CommonMark), reStructuredText, AsciiDoc, MediaWiki markup, DokuWiki markup, Emacs Org-Mode, Textile
  • Custom formats: custom writers can be written in lua

I use Ubuntu because it is the only distro that does not bundle pandoc in the haskell libraries. With pandoc, you can specify the template that you are using, so that the same one document can be formatted quickly in many different ways and file formats.

Workflow:

  1. Write using vim or other text editor. When I was starting, I used a markdown previewer
  2. Create the template for the client
  3. Convert document appropriately

Use markdown for:

  • taking notes
  • creating SOPs
  • Creating User guides (Image Magick mogrify)
  • Creating things for my website

Other programs and tools:

  • Retext
  • Haroopad
  • discount
  • stackedit.io
  • atom
  • texlive for going direct to pdf

Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2015-08-11T08:01:01Z by 0xf10e

thx, very useful

Nice episode, many little things I didn't know about markdown.

While I prefer ReStructuredText* over markdown (just like I prefer Mercurial/Python/Golang over Git/Perl/Java) I have to use it on Gitlab and Github.
So like I said, very useful.

*) and rst2pdf works w/o LaTeX ;)

PS: one of the words you were looking for is WYSIWYG - "what you see is what you get"

Comment #2 posted on 2015-08-12T11:16:31Z by Jon Kulp

plus HTML as needed

Thanks I enjoyed this episode. One thing I would add is that whenever necessary you can freely add bits of HTML when the markdown syntax doesn't give you everything you need.

Comment #3 posted on 2015-08-17T18:04:55Z by Dave Morriss

Excellent episode

This was a great episode.

I use Markdown and Pandoc myself for all my HPR episodes, though I have not yet moved away from AsciiDoc when writing my own project notes and similar.

A while ago, I had been looking for the best lightweight markup format and was very happy to find Markdown. Then I found Pandoc and very much appreciated its extensions and huge range of features.

Thanks for your great overview.

Leave Comment

Powered by Comment Script