|
Text.Pandoc | Portability | portable | Stability | alpha | Maintainer | John MacFarlane <jgm@berkeley.edu> |
|
|
|
|
|
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
-- include the following two lines only if you're using ghc < 6.12:
import Prelude hiding (getContents, putStrLn)
import System.IO.UTF8
markdownToRST :: String -> String
markdownToRST =
(writeRST defaultWriterOptions {writerReferenceLinks = True}) .
readMarkdown defaultParserState
main = getContents >>= putStrLn . markdownToRST
Note: all of the readers assume that the input text has '\n'
line endings. So if you get your input text from a web form,
you should remove '\r' characters using filter (/='\r').
|
|
Synopsis |
|
|
|
|
Definitions
|
|
module Text.Pandoc.Definition |
|
Readers: converting to Pandoc format
|
|
|
:: ParserState | Parser state, including options for parser
| -> String | String to parse (assuming '\n' line endings)
| -> Pandoc | | Read markdown from an input string and return a Pandoc document.
|
|
|
|
:: ParserState | Parser state, including options for parser
| -> String | String to parse (assuming '\n' line endings)
| -> Pandoc | | Parse reStructuredText string and return Pandoc document.
|
|
|
|
:: ParserState | Parser state, including options for parser
| -> String | String to parse (assumes '\n' line endings)
| -> Pandoc | | Parse LaTeX from string and return Pandoc document.
|
|
|
|
|
|
Parser state used in readers
|
|
|
Parsing options.
| Constructors | ParserState | | stateParseRaw :: Bool | Parse raw HTML and LaTeX?
| stateParserContext :: ParserContext | Inside list?
| stateQuoteContext :: QuoteContext | Inside quoted environment?
| stateSanitizeHTML :: Bool | Sanitize HTML?
| stateKeys :: KeyTable | List of reference keys
| stateNotes :: NoteTable | List of notes
| stateTabStop :: Int | Tab stop
| stateStandalone :: Bool | Parse bibliographic info?
| stateTitle :: [Inline] | Title of document
| stateAuthors :: [[Inline]] | Authors of document
| stateDate :: [Inline] | Date of document
| stateStrict :: Bool | Use strict markdown syntax?
| stateSmart :: Bool | Use smart typography?
| stateLiterateHaskell :: Bool | Treat input as literate haskell
| stateColumns :: Int | Number of columns in terminal
| stateHeaderTable :: [HeaderType] | Ordered list of header types used
| stateIndentedCodeClasses :: [String] | Classes to use for indented code blocks
|
|
|
|
|
|
|
|
Constructors | ListItemState | Used when running parser on list item contents
| NullState | Default state
|
|
|
|
|
Constructors | InSingleQuote | Used when parsing inside single quotes
| InDoubleQuote | Used when parsing inside double quotes
| NoQuote | Used when not parsing inside quotes
|
|
|
|
|
|
|
|
|
Constructors | SingleHeader Char | Single line of characters underneath
| DoubleHeader Char | Lines of characters above and below
|
|
|
|
Writers: converting from Pandoc format
|
|
|
Convert Pandoc to Markdown.
|
|
|
Convert Pandoc to plain text (like markdown, but without links,
pictures, or inline formatting).
|
|
|
Convert Pandoc to RST.
|
|
|
Convert Pandoc to LaTeX.
|
|
|
Convert Pandoc to ConTeXt.
|
|
|
Convert Pandoc to Texinfo.
|
|
|
Convert Pandoc document to Html structure.
|
|
|
Convert Pandoc document to Html string.
|
|
|
Converts Pandoc document to an S5 HTML presentation (Html structure).
|
|
|
Converts Pandoc document to an S5 HTML presentation (string).
|
|
|
Convert Pandoc document to string in Docbook format.
|
|
|
Convert Pandoc document to string in OpenDocument format.
|
|
|
Convert Pandoc to Man.
|
|
|
Convert Pandoc to MediaWiki.
|
|
|
Convert Pandoc to a string in rich text format.
|
|
|
Prettyprint Pandoc document.
|
|
Writer options used in writers
|
|
|
Options for writers
| Constructors | WriterOptions | | writerStandalone :: Bool | Include header and footer
| writerTemplate :: String | Template to use in standalone mode
| writerVariables :: [(String, String)] | Variables to set in template
| writerIncludeBefore :: String | Text to include before the body
| writerIncludeAfter :: String | Text to include after the body
| writerTabStop :: Int | Tabstop for conversion btw spaces and tabs
| writerTableOfContents :: Bool | Include table of contents
| writerS5 :: Bool | We're writing S5
| writerXeTeX :: Bool | Create latex suitable for use by xetex
| writerHTMLMathMethod :: HTMLMathMethod | How to print math in HTML
| writerIgnoreNotes :: Bool | Ignore footnotes (used in making toc)
| writerIncremental :: Bool | Incremental S5 lists
| writerNumberSections :: Bool | Number sections in LaTeX
| writerStrictMarkdown :: Bool | Use strict markdown syntax
| writerReferenceLinks :: Bool | Use reference links in writing markdown, rst
| writerWrapText :: Bool | Wrap text to line length
| writerLiterateHaskell :: Bool | Write as literate haskell
| writerEmailObfuscation :: ObfuscationMethod | How to obfuscate emails
| writerIdentifierPrefix :: String | Prefix for section & note ids in HTML
|
|
|
|
|
|
|
|
|
Default writer options.
|
|
Rendering templates and default templates
|
|
module Text.Pandoc.Templates |
|
Version
|
|
|
Version number of pandoc library.
|
|
Produced by Haddock version 2.6.0 |