Expand: Towards an Extensible Pandoc System
Autor: | Doaitse Swierstra, Jacco Krijnen, Marcos Viera |
---|---|
Rok vydání: | 2014 |
Předmět: | |
Zdroj: | Practical Aspects of Declarative Languages ISBN: 9783319041315 PADL |
Popis: | 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. |
Databáze: | OpenAIRE |
Externí odkaz: |