Pandoc: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "== Pandoc == 400px|right A universal document converter - converts from one markup language onto another https://pandoc.org/ Use: convert downlo...")
 
No edit summary
Line 33: Line 33:


'''page.wiki''' - mediawiki input filename
'''page.wiki''' - mediawiki input filename
[[Category:Cookbook]]

Revision as of 14:46, 25 November 2019

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