Pandoc
Convert documents between markup formats, structure intact
About
Pandoc turns documents from one markup format into another. It reads and writes dozens, from Markdown and HTML to Word, PDF and slides. Reach for it when a document needs to move between formats.
Install it
pkg install pandoc
Run this inside Termux. If the package is already present, pkg will say so and
do nothing.
Commands worth knowing
6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.
pandoc notes.md -o notes.html Convert a Markdown file into an HTML page. pandoc report.docx -o report.md Turn a Word document into Markdown. Useful for putting prose under version control. pandoc notes.md -o notes.pdf Render Markdown to a PDF. Needs a PDF engine installed alongside. pandoc notes.md -s -o notes.html Produce a standalone page with a full HTML skeleton, rather than a fragment. pandoc notes.md -o slides.pptx Build a presentation from a Markdown file with slide separators. pandoc -f html -t markdown page.html Convert from a named input format to a named output format, overriding the guess from the extension. Worked example
Run pandoc notes.md -t html and this is what you should see.
$ pandoc notes.md -t html
<h1 id="intro">Intro</h1>
<p>This is a short note.</p>
<ul>
<li>first point</li>
<li>second point</li>
</ul> Without an output file, the result is printed to the terminal.
Developed by
John MacFarlane · released under GPL-2.0-or-later.