Pandoc

From Publication Station

Pandoc

pandoc: is a software for converting text between different markups

Pandoc diagram.png




mark a text in MS Word/Libre Office

create a .docx file and mark it up with a few of the following paragraph and characters styles:

  • headings
  • body text
  • block quotes: indented blocks of text
  • footnotes
  • hyperlinks
  • Preformatted text
  • Bold
  • Italics

Save in .docx

convert

Convert your docx file into a an HTML file using Pandoc.

shell
pandoc -f docx -t html5 -s input.docx -o output.html

pandoc - program dedicate to the conversion between different markups.

-f - option standing for “from”, is followed by the input format;

-t - option standing for “to”, is followed by the output format;

-s - option standing for “standalone”, produces output with an appropriate header and footer;

-o - option for file output;

input.docx - docx input filename - you need to replace it by its actual name

convert once more, now toward Markdown

-t markdown Option: toward Markdown

--atx-headeres Option: use nice Markdown headers

Why Markdown ?

  • simple
  • only one way to create a structure
  • compatible with HTML, but easier to read and write
  • allows the inclusion of HTML tags.
  • any plain text editor such as Sublime Text or Gedit can edit Markdown files.
  • there are WYSIWYG Markdown editors such as MacDown.