Building a website in Markdown with Pandoc

Creating a website is a lot of trouble – especially if you just have a few files you wish to publish online. You could type in all the HTML codes by hand, or you could employ a graphic design tool that looks simple but still might be more effort than you want to spend.

Another easier option is to use Pandoc [1]. Pandoc is a universal document converter. You can give Pandoc a text file in any of several markup formats, and it will convert the document to any of several output formats. One common scenario is to format a text file using the simple and expressive Markdown markup language and then use Pandoc to convert the file to an HTML page. Pandoc is a command-line tool, so it allows you to convert a file to HTML in a single command. A collection of command-line options lets you add extra features to the web page, such as a footer bar or a rudimentary navigation menu. With the right libraries, Pandoc can even read programming languages.

You wouldn't want to use Pandoc for a complex site with interactive features and a backend database, but if you are just looking for a quick-and-dirty tool for publishing text to the web, Pandoc is a very good option. For instance, some organizations use Pandoc in situations where there is a need to maintain documentation that is accessible from the command line but still easily convertible to HTML.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Swiss Army Knife

    Pandoc lets you convert files from one markup format to another at the command line.

  • DocumentConversion

    In search of a tool for creating multiple documents from a single source, Bruce revisits the universal document converter, pandoc.

  • Workspace – Bash PubKit

    Generate e-books from Markdown-formatted text files quickly and reliably using Bash PubKit.

  • UberWriter

    The UberWriter text editor, which is optimized for Markdown, includes a number of interesting features and does some amazing things. We show you how it works.

  • Tutorials – Markdown

    Create attractive and structured documents from the comfort of your text editor – and convert them to a huge array of formats.

comments powered by Disqus