Pandoc demo

Pandoc Demo

You have learned about TEI now––so what? Where can you start? Let's now learn how we can make use of the text we encoded in Markdown to add more semantic tags to the document.

This video demo below shows how you can use Pandoc to convert a document written in Markdown into basic XML structure, paving the way for more semantic markup in TEI. As I say in the video, Pandoc is a terrific tool for converting all kinds of documents. It can also help you transform a quickly-authored transcription in Markdown into XML structure, which saves you some time.

To follow along, you will need to have installed Pandoc. You should also use either your Markdown transcription of the Pope text from the previous session or your own text.


For Mac and Linux: 

For those on Mac OS, and most Linux installations, you already have a bash shell installed.

Open your Terminal (Applications > Utilities > Terminal).

Windows Only: Installing Git Bash

You will need to install Git Bash. This can be installed by downloading the most recent ‘Full installer’ at this page. Instructions for installation are available at Open Hatch.

Pandoc syntax used in the video:

To change directories in your Terminal (or Git Bash shell): 

First, type cd  then hit enter (this takes you to your home directory).

In the video I enter cd Dropbox : this takes me to my Dropbox folder (you can just navigate to the directory where your Markdown file lives).

To convert from md to xml: pandoc -o pope_dunciad_markup_exercise.xml

To convert from md to TEI XML: pandoc -o pope_dunciad_markup_exercise.xml --to=tei

To learn more about working on the command line interface, check out this useful tutorial:

Pandoc is a universal document converter from the command line:

    • Converts md to docx, html, PDF, and pretty much anything else...

      • Sample syntax: pandoc -o text.html

    • Converts to TEI (simple).

      • Sample syntax: pandoc -o text.xml --to=tei

See the user manual:
Last modified: Tuesday, 24 November 2020, 2:40 PM