Pandoc

From Publication Station

Pandoc

[edit]

pandoc: is a software for converting text between different markups




mark a text in MS Word/Libre Office

[edit]

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

[edit]

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

[edit]

-t markdown Option: toward Markdown

--atx-headeres Option: use nice Markdown headers

Why Markdown ?

[edit]
  • 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.