Expand: Towards an Extensible Pandoc System

  • Jacco Krijnen
  • Doaitse Swierstra
  • Marcos O. Viera
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8324)

Abstract

The Pandoc program is a versatile tool for converting between document formats. It comes with a great variety of readers, each converting a specific input format into the universal Pandoc format, and a great variety of writers, each mapping a document represented in this universal format onto a specific output format.

Unfortunately the intermediate Pandoc format is fixed, which implies that a new, unforeseen document element cannot be added. In this paper we propose a more flexible approach, using our collection of Haskell libraries for constructing extensible parsers and attribute grammars. Both the parsing and the unparsing of a specific document can be constructed out of a collection of precompiled descriptions of document elements written in Haskell. This collection can be extended by any user, without having to touch existing code.

The Haskell type system is used to enforce that each component is well defined, and to verify that the composition of a collection components is consistent, i.e. that features needed by a component have been defined by that component or any of the other components. In this way we can get back the flexibility e.g. offered by the packages in the \(\mbox{\LaTeX}\) package eco-system.

Keywords

Document Formatting Pandoc Attribute Grammars Parsing Haskell Type System 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Jacco Krijnen
    • 1
  • Doaitse Swierstra
    • 1
  • Marcos O. Viera
    • 2
  1. 1.Department of Computer ScienceUtrecht UniversityUtrechtThe Netherlands
  2. 2.Instituto de ComputaciónUniversidad de la RepúblicaMontevideoUruguay

Personalised recommendations