pandoc-builder-monadic: A monadic DSL for building pandoc documents

[ bsd3, library, text ] [ Propose Tags ]

A convenient way to build pandoc documents. Supports all of the applicative and monadic utilities, and reduces syntactic noise via do notation.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0, 1.1.0, 1.1.1
Change log CHANGELOG.md
Dependencies base (>=4.9.0.0 && <5), dlist (>=0.2 && <2), mtl (>=1.1.0.0 && <3), pandoc-types (>=1.21 && <2), text (>=0.2 && <3) [details]
License BSD-3-Clause
Author Owen Shepherd
Maintainer owen@owen.cafe
Category Text
Home page https://github.com/414owen/pandoc-builder-monadic
Uploaded by 414owen at 2023-11-26T17:09:52Z
Distributions NixOS:1.1.1
Downloads 90 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for pandoc-builder-monadic-1.1.0

[back to package description]

pandoc-builder-monadic

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"