Safe Haskell | None |
---|---|
Language | Haskell2010 |
- markdownToHTML :: Text -> Action Value
- markdownToHTML' :: FromJSON a => Text -> Action a
- makePandocReader :: PandocReader textType -> textType -> Action (Pandoc, Value)
- makePandocReader' :: FromJSON a => PandocReader textType -> textType -> Action (Pandoc, a)
- loadUsing :: PandocReader textType -> PandocWriter -> textType -> Action Value
- loadUsing' :: FromJSON a => PandocReader textType -> PandocWriter -> textType -> Action a
- convert :: (FromJSON a, ToJSON a, FromJSON b) => a -> Action b
- html5Options :: WriterOptions
- markdownOptions :: ReaderOptions
- type PandocReader textType = textType -> PandocIO Pandoc
- type PandocWriter = Pandoc -> PandocIO Text
Documentation
markdownToHTML :: Text -> Action Value Source #
Convert markdown text into a Value
;
The Value
has a "content" key containing rendered HTML
Metadata is assigned on the respective keys in the Value
markdownToHTML' :: FromJSON a => Text -> Action a Source #
Like markdownToHTML
but allows returning any JSON serializable object
makePandocReader :: PandocReader textType -> textType -> Action (Pandoc, Value) Source #
Given a reader from Readers
this creates a loader which
given the source document will read its metadata into a Value
returning both the Pandoc
object and the metadata within an Action
makePandocReader' :: FromJSON a => PandocReader textType -> textType -> Action (Pandoc, a) Source #
Like makePandocReader
but will deserialize the metadata into any object
which implements FromJSON
. Failure to deserialize will fail the Shake
build.
loadUsing :: PandocReader textType -> PandocWriter -> textType -> Action Value Source #
Load in a source document using the given PandocReader
, then render the Pandoc
into text using the given PandocWriter
.
Returns a Value
wherein the rendered text is set to the "content" key and
any metadata is set to its respective key in the Value
loadUsing' :: FromJSON a => PandocReader textType -> PandocWriter -> textType -> Action a Source #
Like loadUsing
but allows also deserializes the Value
into any object
which implements FromJSON
. Failure to deserialize will fail the Shake
build.
convert :: (FromJSON a, ToJSON a, FromJSON b) => a -> Action b Source #
Attempt to convert between two JSON serializable objects (or Value
s).
Failure to deserialize fails the Shake build.
html5Options :: WriterOptions Source #
Reasonable options for rendering to HTML
markdownOptions :: ReaderOptions Source #
Reasonable options for reading a markdown file
type PandocReader textType = textType -> PandocIO Pandoc Source #
type PandocWriter = Pandoc -> PandocIO Text Source #