compdoc-0.3.0.0: Parse a Pandoc to a composite value.
LicenseMIT
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Text.Compdoc

Description

Provides functionality for transforming a Pandoc into a composite record.

Synopsis

Documentation

type FContent = (:->) "content" Text Source #

fContent :: forall f rs. (Functor f, (∈) FContent rs) => (Text -> f Text) -> Record rs -> f (Record rs) Source #

newtype Compdoc a Source #

A Compdoc is a Record with at least an FContent field.

Since: 0.3.0.0

Constructors

Compdoc 

Fields

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 #

Transform a Pandoc to a Compdoc supplying a `JsonFormat for the metadata.

Since: 0.1.0.0

contentBlock :: WriterOptions -> [Block] -> Record (FContent ': '[]) Source #

Create the tail of a Compdoc which is just an FContent field.

Since: 0.1.0.0

writeBlocksDefault :: WriterOptions -> [Block] -> Text Source #

Write a list of Blocks 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