pandoc-3.6.3: Conversion between markup formats

Copyright | Copyright (C) 2006-2024 John MacFarlane
License | GNU GPL, version 2 or above
Maintainer | John MacFarlane <jgm@berkeley.edu>
Stability | alpha
Portability | portable
Safe Haskell | None
Language | Haskell2010

Text.Pandoc.Readers

Contents

- Readers: converting to Pandoc format
- Miscellaneous

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

- data Reader (m :: Type -> Type)
  - = TextReader (forall a. ToSources a => ReaderOptions -> a -> m Pandoc)
  - | ByteStringReader (ReaderOptions -> ByteString -> m Pandoc)
- readers :: forall (m :: Type -> Type). PandocMonad m => [(Text, Reader m)]
- readDocx :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc
- readODT :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc
- readMarkdown :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readCommonMark :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readCreole :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readDokuWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readMediaWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readVimwiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readRST :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readOrg :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readLaTeX :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readHtml :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readJATS :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readJira :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readTextile :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readDocBook :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readOPML :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readHaddock :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readNative :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readJSON :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readTWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readTikiWiki :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readTxt2Tags :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readEPUB :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc
- readMuse :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readMan :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readMdoc :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readFB2 :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readIpynb :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readCSV :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readTSV :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readCslJson :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readBibTeX :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readBibLaTeX :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readEndNoteXML :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readRIS :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readRTF :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readTypst :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readDjot :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- readPod :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- getReader :: PandocMonad m => FlavoredFormat -> m (Reader m, Extensions)
- getDefaultExtensions :: Text -> Extensions

# Readers: converting to Pandoc format

data Reader (m :: Type -> Type) #

Constructors

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

readers :: forall (m :: Type -> Type). PandocMonad m => [(Text, Reader m)] #

Association list of formats and readers.

readDocx :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc #

readODT :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc #

readMarkdown #

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 #

Parse a CommonMark formatted string into a `Pandoc` structure.

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

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

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

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

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

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

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

readRST #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a |
-> m Pandoc |

Parse reStructuredText string and return Pandoc document.

readOrg #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a |
-> m Pandoc |

Parse org-mode string and return a Pandoc document.

readLaTeX #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a | Input to parse
-> m Pandoc |

Parse LaTeX from string and return `Pandoc` document.

readHtml #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a | Input to parse
-> m Pandoc |

Convert HTML-formatted string to `Pandoc` document.

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

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

Read Jira wiki markup.

readTextile #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a |
-> m Pandoc |

Parse a Textile text and return a Pandoc document.

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

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

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

Parse Haddock markup and return a `Pandoc` document.

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

Read pandoc document from JSON format.

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

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

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

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

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

Read Txt2Tags from an input string returning a Pandoc document

readEPUB :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc #

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

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

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

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

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

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

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

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

readCSV #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a |
-> m Pandoc |

readTSV #

Arguments

:: (PandocMonad m, ToSources a) |
=> ReaderOptions | Reader options
-> a |
-> m Pandoc |

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

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 #

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 #

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 #

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 #

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 #

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

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

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

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

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

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

# Miscellaneous

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

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

getDefaultExtensions :: Text -> Extensions #

Default extensions from format-describing string.