Pandoc

Overview #

If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Cite

Installation #

Pandoc is free open source software. This utility is available for Windows and most major Linux distrobutions. Please review the official documentation for how to install this software for your OS.

Getting started #

Pandoc is a command-line tool. There is no graphic user interface. In order to use it, open a terminal .

Verify that Pandoc is installed:

pandoc --version

Basic Usage #

Pandoc can be used as a command-line interpretor. Pandoc can take input that’s written in a syntax that it recognizes and convert it to another syntax. By default pandoc interprets input as Markdown and output as HTML.

To open the Pandoc interpretor just type pandoc into your terminal and press Enter:

[akraker@localhost ~]$ pandoc
Hello *pandoc*!

- one
- two

In the above example, Markdown is typed into the terminal. Once complete use Ctrl-D and then Enter to signify the End of File (EOF) in a Linux environment or use Ctrl-Z + Enter in a Windows environment.

The above example will convert your Markdown into HTML like this:

<p>Hello <em>pandoc</em>!</p>
<ul>
<li>one</li>
<li>two</li>
</ul>

Where pandoc really shines is it’s ability to take a file written in one syntax and convert it to another syntax. To do this via the CLI:

pandoc -f markdown -t mediawiki /path/to/file.md

Where -f is the input file syntax and -t is the output file syntax. Here’s an example using this article:

[akraker@localhost wiki_articles]$ pandoc -f markdown -t mediawiki pandoc.md | head
= Overview =

<blockquote>If you need to convert files from one markup format into another, pandoc is your swiss-army knife. [https://pandoc.org Cite]
</blockquote>
== Installation ==

Pandoc is free open source software. This utility is available for Windows and most major Linux distrobutions. Please review the official documentation for how to [https://pandoc.org/installing.html install] this software for your OS.

== Getting started ==

You’ll notice that by default pandoc will convert your file and output the result to the terminal. In most cases it’s most useful to just redirect this output directly to a file.

pandoc -f markdown -t mediawiki pandoc.md > pandoc.mediawik

or pandoc has a flag for writing output to a file as well

pandoc test1.md -f markdown -t html -s -o test1.html

Advanced Usage #

For more advanced usage feel free to review the official getting started guide, the official manual , or use the built-in help docs:

pandoc --help
man pandoc

See Also #