Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.09 KB

README.md

File metadata and controls

26 lines (20 loc) · 1.09 KB

pandoc-builder-monadic

GHC version badge CI status badge Hackage version badge license

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"