Pandoc

From XPUB & Lens-Based wiki
Revision as of 13:46, 25 November 2019 by Andre Castro (talk | contribs) (Created page with "== Pandoc == 400px|right A universal document converter - converts from one markup language onto another https://pandoc.org/ Use: convert downlo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Pandoc

Pandoc diagram.jpg

A universal document converter - converts from one markup language onto another

https://pandoc.org/

Use: convert downloaded wiki pages onto HTML files

extensive documentation in Pandoc’s Manual or man pandoc


pandoc example1: convert HTML string to markdown

echo "<h1>Hello Pandoc</h1><p>from html to markdown</p>" | pandoc -f html -t markdown

pandoc example2: mediawiki file to HTML

  • Save the content of a wiki page on to a plain-text file, example: page.wiki
  • convert:

pandoc page.wiki -f mediawiki -t html -o page.html


Pandoc common arguments

-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;

page.wiki - mediawiki input filename