From 443cf9c70ad686761d399f19f94dbd214f0f9107 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Sun, 12 Nov 2023 15:09:46 +0100 Subject: [PATCH] fix: Example code in the README --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ba31207..0f24e23 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,23 @@ This module provides a monadic DSL for constructing Pandoc documents. +## Usage ```haskell +{-# LANGUAGE OverloadedStrings #-} + import Text.Pandoc.Builder.Monadic myDoc :: Pandoc myDoc = doc $ do - h1 "Work log" + h1 "Hello, World!" para $ do - kv "month" "2023-10" - emph $ str k - str ": " - linebreak + str "Lorem ipsum " + () <- "dolor sit amet" + traverse (str . T.pack . show) [1..10 :: Int] + pure () para $ do - code "Wow, such code!" - code "It's a monoid too" <> strong "'cos why not" + strong "Wow, such code!" + softbreak + "It's a " <> strong "monoid" <> " too" <> emph "'cos why not" ```