Copyright | Copyright (C) 2006-2020 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <jgm@berkeley.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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
- = TextReader (ReaderOptions -> Text -> m Pandoc)
- | ByteStringReader (ReaderOptions -> ByteString -> m Pandoc)
- readers :: PandocMonad m => [(Text, Reader m)]
- readDocx :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc
- readOdt :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc
- readMarkdown :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readCreole :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readDokuWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readMediaWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readVimwiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readRST :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readOrg :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readHtml :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readJATS :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readJira :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readTextile :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readDocBook :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readOPML :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readHaddock :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readNative :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readJSON :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readTWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readTikiWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readTxt2Tags :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readEPUB :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc
- readMuse :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readFB2 :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readIpynb :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- readCSV :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
- getReader :: PandocMonad m => Text -> m (Reader m, Extensions)
- getDefaultExtensions :: Text -> Extensions
Readers: converting to Pandoc format
TextReader (ReaderOptions -> Text -> m Pandoc) | |
ByteStringReader (ReaderOptions -> ByteString -> m Pandoc) |
readDocx :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc Source #
readOdt :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc Source #
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | String to parse (assuming |
-> 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.
readDokuWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
Read DokuWiki from an input string and return a Pandoc document.
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | String to parse (assuming |
-> m Pandoc |
Read mediawiki from an input string and return a Pandoc document.
readVimwiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | Text to parse (assuming |
-> m Pandoc |
Parse reStructuredText string and return Pandoc document.
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | String to parse (assuming |
-> m Pandoc |
Parse org-mode string and return a Pandoc document.
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | String to parse (assumes |
-> m Pandoc |
Parse LaTeX from string and return Pandoc
document.
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | String to parse (assumes |
-> m Pandoc |
Convert HTML-formatted string to Pandoc
document.
readJATS :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
readJira :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
Read Jira wiki markup.
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | String to parse (assuming |
-> m Pandoc |
Parse a Textile text and return a Pandoc document.
readDocBook :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
readOPML :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
readHaddock :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
Parse Haddock markup and return a Pandoc
document.
:: PandocMonad m | |
=> ReaderOptions | |
-> Text | String to parse (assuming |
-> 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 => ReaderOptions -> Text -> m 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
readEPUB :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc Source #
readMuse :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
Read Muse from an input string and return a Pandoc document.
readFB2 :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
readIpynb :: PandocMonad m => ReaderOptions -> Text -> m Pandoc Source #
:: PandocMonad m | |
=> ReaderOptions | Reader options |
-> Text | Text to parse (assuming |
-> m Pandoc |
Miscellaneous
getReader :: PandocMonad m => Text -> m (Reader m, Extensions) Source #
Retrieve reader, extensions based on formatSpec (format+extensions).
getDefaultExtensions :: Text -> Extensions Source #
Default extensions from format-describing string.