License | MIT |
---|---|
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Provides functionality for transforming a Pandoc
into a composite record.
Synopsis
- type FContent = (:->) "content" Text
- fContent :: forall f rs. (Functor f, (∈) FContent rs) => (Text -> f Text) -> Record rs -> f (Record rs)
- newtype Compdoc a = Compdoc {}
- readMarkdown' :: (Show e, Typeable e, MonadThrow m) => ReaderOptions -> WriterOptions -> JsonFormat e (Record a) -> Text -> m (Compdoc a)
- readMarkdownFile :: (MonadIO m, MonadThrow m, Show e, Typeable e) => ReaderOptions -> WriterOptions -> JsonFormat e (Record a) -> Path b File -> m (Compdoc a)
- runPandocPureDefault :: a -> PandocPure a -> a
- pandocToCompdoc :: (Typeable e, Show e, MonadThrow m) => (WriterOptions -> Pandoc -> PandocPure Text) -> WriterOptions -> JsonFormat e (Record a) -> Pandoc -> m (Compdoc a)
- contentBlock :: WriterOptions -> [Block] -> Record (FContent ': '[])
- writeBlocksDefault :: WriterOptions -> [Block] -> Text
- flattenMeta :: MonadThrow m => (Pandoc -> PandocPure Text) -> Meta -> m Value
Documentation
fContent :: forall f rs. (Functor f, (∈) FContent rs) => (Text -> f Text) -> Record rs -> f (Record rs) Source #
A Compdoc is a Record with at least an FContent field.
Since: 0.3.0.0
readMarkdown' :: (Show e, Typeable e, MonadThrow m) => ReaderOptions -> WriterOptions -> JsonFormat e (Record a) -> Text -> m (Compdoc a) Source #
Read some Pandoc
markdown as Text
as a `Record (Compdoc a)` supplying a JsonFormat
for the metadata.
Since: 0.1.0.0
readMarkdownFile :: (MonadIO m, MonadThrow m, Show e, Typeable e) => ReaderOptions -> WriterOptions -> JsonFormat e (Record a) -> Path b File -> m (Compdoc a) Source #
Read a markdown file from disk, supplying a JsonFormat
for the metadata.
Since: 0.1.0.0
runPandocPureDefault :: a -> PandocPure a -> a Source #
Run a PandocPure
operation with a default value in the event of failure.
Since: 0.1.0.0
pandocToCompdoc :: (Typeable e, Show e, MonadThrow m) => (WriterOptions -> Pandoc -> PandocPure Text) -> WriterOptions -> JsonFormat e (Record a) -> Pandoc -> m (Compdoc a) Source #
contentBlock :: WriterOptions -> [Block] -> Record (FContent ': '[]) Source #
writeBlocksDefault :: WriterOptions -> [Block] -> Text Source #
Write a list of Block
s to Text
using WriterOptions
defaulting to the empty string
in the case of error.
Since: 0.1.0.0
flattenMeta :: MonadThrow m => (Pandoc -> PandocPure Text) -> Meta -> m Value Source #
Flatten pandoc metadata to an aeson value.
Since: 0.1.0.0