| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| Description | |||||||||||||||||||||||||||||||||||||||
This helper module exports the main writers, readers, and data structure definitions from the Pandoc libraries. A typical application will chain together a reader and a writer to convert strings from one format to another. For example, the following simple program will act as a filter converting markdown fragments to reStructuredText, using reference-style links instead of inline links: module Main where
import Text.Pandoc
markdownToRST :: String -> String
markdownToRST = toUTF8 .
(writeRST defaultWriterOptions {writerReferenceLinks = True}) .
(readMarkdown defaultParserState) . fromUTF8
main = interact markdownToRST
| |||||||||||||||||||||||||||||||||||||||
| Synopsis | |||||||||||||||||||||||||||||||||||||||
| Definitions | |||||||||||||||||||||||||||||||||||||||
| module Text.Pandoc.Definition | |||||||||||||||||||||||||||||||||||||||
| Readers: converting to Pandoc format | |||||||||||||||||||||||||||||||||||||||
| readMarkdown :: ParserState -> String -> Pandoc | |||||||||||||||||||||||||||||||||||||||
| Read markdown from an input string and return a Pandoc document. | |||||||||||||||||||||||||||||||||||||||
| readRST :: ParserState -> String -> Pandoc | |||||||||||||||||||||||||||||||||||||||
| Parse reStructuredText string and return Pandoc document. | |||||||||||||||||||||||||||||||||||||||
| readLaTeX | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| readHtml | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| Parser state used in readers | |||||||||||||||||||||||||||||||||||||||
| data ParserState | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| defaultParserState :: ParserState | |||||||||||||||||||||||||||||||||||||||
| data ParserContext | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| data QuoteContext | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| type KeyTable = [([Inline], Target)] | |||||||||||||||||||||||||||||||||||||||
| type NoteTable = [(String, [Block])] | |||||||||||||||||||||||||||||||||||||||
| data HeaderType | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| Writers: converting from Pandoc format | |||||||||||||||||||||||||||||||||||||||
| writeMarkdown :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc to Markdown. | |||||||||||||||||||||||||||||||||||||||
| writeRST :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc to RST. | |||||||||||||||||||||||||||||||||||||||
| writeLaTeX :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc to LaTeX. | |||||||||||||||||||||||||||||||||||||||
| writeConTeXt :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc to ConTeXt. | |||||||||||||||||||||||||||||||||||||||
| writeHtml :: WriterOptions -> Pandoc -> Html | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc document to Html structure. | |||||||||||||||||||||||||||||||||||||||
| writeHtmlString :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc document to Html string. | |||||||||||||||||||||||||||||||||||||||
| writeS5 :: WriterOptions -> Pandoc -> Html | |||||||||||||||||||||||||||||||||||||||
| Converts Pandoc document to an S5 HTML presentation (Html structure). | |||||||||||||||||||||||||||||||||||||||
| writeS5String :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Converts Pandoc document to an S5 HTML presentation (string). | |||||||||||||||||||||||||||||||||||||||
| writeDocbook :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc document to string in Docbook format. | |||||||||||||||||||||||||||||||||||||||
| writeMan :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc to Man. | |||||||||||||||||||||||||||||||||||||||
| writeRTF :: WriterOptions -> Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Convert Pandoc to a string in rich text format. | |||||||||||||||||||||||||||||||||||||||
| prettyPandoc :: Pandoc -> String | |||||||||||||||||||||||||||||||||||||||
| Prettyprint Pandoc document. | |||||||||||||||||||||||||||||||||||||||
| Writer options used in writers | |||||||||||||||||||||||||||||||||||||||
| data WriterOptions | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| Default headers for various output formats | |||||||||||||||||||||||||||||||||||||||
| module Text.Pandoc.Writers.DefaultHeaders | |||||||||||||||||||||||||||||||||||||||
| Functions for converting to and from UTF-8 | |||||||||||||||||||||||||||||||||||||||
| module Text.Pandoc.UTF8 | |||||||||||||||||||||||||||||||||||||||
| Produced by Haddock version 0.8 | |||||||||||||||||||||||||||||||||||||||