Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- markdownReader :: String -> IO String
- textReader :: String -> PandocIO String
- mkPandocReader :: (ReaderOptions -> String -> PandocIO Pandoc) -> String -> IO String
- mkPandocReaderWith :: (ReaderOptions -> String -> PandocIO Pandoc) -> (Pandoc -> PandocIO Pandoc) -> (Pandoc -> PandocIO String) -> String -> IO String
- readMarkdown :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
- pandocToHTML :: Pandoc -> PandocIO String
Built-in readers
Reader Generators
mkPandocReader :: (ReaderOptions -> String -> PandocIO Pandoc) -> String -> IO String Source #
Given any standard pandoc reader (see Text.Pandoc; e.g. readMarkdown
, readDocX
)
makes a resource reader compatible with resourceLoader
.
docs <- resourceLoader (mkPandocReader readDocX) ["docs/*.docx"]
mkPandocReaderWith :: (ReaderOptions -> String -> PandocIO Pandoc) -> (Pandoc -> PandocIO Pandoc) -> (Pandoc -> PandocIO String) -> String -> IO String Source #
Like mkPandocReader
, but allows you to provide both a
transformation,
which is great for things like relativizing links or running transforms over specific document elements.
See https://hackage.haskell.org/package/pandoc-lens for some useful tranformation helpers. You also specify
the tranformation from Pandoc
-> Pandoc
Pandoc -> String
which allows you to pick the output format of the reader.
If you're unsure what to use in this slot, the pandocToHTML function is a good choice.
:: (PandocMonad m, ToSources a) | |
=> ReaderOptions | Reader options |
-> a | Input |
-> m Pandoc |
Read markdown from an input string and return a Pandoc document.
Pandoc Writers
pandocToHTML :: Pandoc -> PandocIO String Source #
A simple helper which renders pandoc to HTML; good for use with mkPandocReaderWith