Skip to content

Commit

Permalink
fix: Example code in the README
Browse files Browse the repository at this point in the history
  • Loading branch information
414owen committed Nov 12, 2023
1 parent 8cda486 commit 443cf9c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

0 comments on commit 443cf9c

Please sign in to comment.