pandoc-3.2.1: Conversion between markup formats
CopyrightCopyright (C) 2006-2024 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Pandoc.Readers

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

data Reader m Source #

Constructors

TextReader (forall a. ToSources a => ReaderOptions -> a -> m Pandoc) 
ByteStringReader (ReaderOptions -> ByteString -> m Pandoc) 

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

Association list of formats and readers.

readMarkdown Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a

Input

-> m Pandoc 

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

readCommonMark :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Parse a CommonMark formatted string into a Pandoc structure.

readCreole :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readDokuWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readMediaWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readRST Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a 
-> m Pandoc 

Parse reStructuredText string and return Pandoc document.

readOrg Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a 
-> m Pandoc 

Parse org-mode string and return a Pandoc document.

readLaTeX Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a

Input to parse

-> m Pandoc 

Parse LaTeX from string and return Pandoc document.

readHtml Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a

Input to parse

-> m Pandoc 

Convert HTML-formatted string to Pandoc document.

readJira :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read Jira wiki markup.

readTextile Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a 
-> m Pandoc 

Parse a Textile text and return a Pandoc document.

readHaddock :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Parse Haddock markup and return a Pandoc document.

readNative :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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 :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read pandoc document from JSON format.

readTWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readTikiWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readTxt2Tags :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read Txt2Tags from an input string returning a Pandoc document

readMuse :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readMan :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read man (troff) from an input string and return a Pandoc document.

readCSV Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a 
-> m Pandoc 

readTSV Source #

Arguments

:: (PandocMonad m, ToSources a) 
=> ReaderOptions

Reader options

-> a 
-> m Pandoc 

readCslJson :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read CSL JSON from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.

readBibTeX :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read BibTeX from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.

readBibLaTeX :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read BibLaTeX from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.

readEndNoteXML :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read EndNote XML from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.

readRIS :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

Read RIS from an input string and return a Pandoc document. The document will have only metadata, with an empty body. The metadata will contain a references field with the bibliography entries, and a nocite field with the wildcard `[@*]`.

readRTF :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readTypst :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

readDjot :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc Source #

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

Miscellaneous

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

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

getDefaultExtensions :: Text -> Extensions Source #

Default extensions from format-describing string.