Description
A monadic DSL for building pandoc documents.
Description
A convenient way to build pandoc documents. Supports all of the applicative and monadic utilities, and reduces syntactic noise via do notation.
README.md
pandoc-builder-monadic
This library provides a monadic DSL for constructing Pandoc documents.
Usage
{-# LANGUAGE OverloadedStrings #-}
import Text.Pandoc.Builder.Monadic
myDoc :: Pandoc
myDoc = doc $ do
h1 "Hello, World!"
para $ do
str "Lorem ipsum "
() <- "dolor sit amet"
traverse (str . T.pack . show) [1..10 :: Int]
pure ()
para $ do
strong "Wow, such code!"
softbreak
"It's a " <> strong "monoid" <> " too" <> emph "'cos why not"