pandoc-2.1.1: Conversion between markup formats

CopyrightCopyright (C) 2006-2018 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Text.Pandoc.Readers

Contents

Description

This helper module exports the readers.

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

Readers: converting to Pandoc format

readers :: PandocMonad m => [(String, Reader m)] Source #

Association list of formats and readers.

readMarkdown Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assuming '\n' line endings)

-> m Pandoc 

Read markdown from an input string and return a Pandoc document.

readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Parse a CommonMark formatted string into a Pandoc structure.

readCreole :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Read creole from an input string and return a Pandoc document.

readMediaWiki Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assuming '\n' line endings)

-> m Pandoc 

Read mediawiki from an input string and return a Pandoc document.

readRST Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assuming '\n' line endings)

-> m Pandoc 

Parse reStructuredText string and return Pandoc document.

readOrg Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assuming '\n' line endings)

-> m Pandoc 

Parse org-mode string and return a Pandoc document.

readLaTeX Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assumes '\n' line endings)

-> m Pandoc 

Parse LaTeX from string and return Pandoc document.

readHtml Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assumes '\n' line endings)

-> m Pandoc 

Convert HTML-formatted string to Pandoc document.

readTextile Source #

Arguments

:: PandocMonad m 
=> ReaderOptions

Reader options

-> Text

String to parse (assuming '\n' line endings)

-> m Pandoc 

Parse a Textile text and return a Pandoc document.

readHaddock :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Parse Haddock markup and return a Pandoc document.

readNative Source #

Arguments

:: PandocMonad m 
=> ReaderOptions 
-> Text

String to parse (assuming '\n' line endings)

-> m Pandoc 

Read native formatted text and return a Pandoc document. The input may be a full pandoc document, a block list, a block, an inline list, or an inline. Thus, for example,

Str "hi"

will be treated as if it were

Pandoc nullMeta [Plain [Str "hi"]]

readJSON :: ReaderOptions -> Text -> Either PandocError Pandoc Source #

Read pandoc document from JSON format.

readTWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Read twiki from an input string and return a Pandoc document.

readTikiWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Read TikiWiki from an input string and return a Pandoc document.

readTxt2Tags :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Read Txt2Tags from an input string returning a Pandoc document

readMuse :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #

Read Muse from an input string and return a Pandoc document.

Miscellaneous

getReader :: PandocMonad m => String -> Either String (Reader m, Extensions) Source #

Retrieve reader, extensions based on formatSpec (format+extensions).

getDefaultExtensions :: String -> Extensions Source #

Default extensions from format-describing string.