Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ocramz/blaze-html-qq

Quasiquoter for blaze-html
https://github.com/ocramz/blaze-html-qq

htmx-template quasiquoter web

Last synced: 22 days ago
JSON representation

Quasiquoter for blaze-html

Awesome Lists containing this project

README

        

# blaze-html-qq

[![CI](https://github.com/ocramz/blaze-html-qq/actions/workflows/ci.yml/badge.svg)](https://github.com/ocramz/blaze-html-qq/actions/workflows/ci.yml)

QuasiQuoter for [`blaze-html`](https://hackage.haskell.org/package/blaze-html). Parse inline HTML snippets at compile time and produce `MarkupM` values, e.g.

```haskell
{-# language QuasiQuotes #-}
-- blaze-html
import qualified Text.Blaze.Html.Renderer.Text as BT (renderHtml)
-- text
import qualified Data.Text.Lazy as TL (Text)

import Text.Blaze.HTML.QQ (blaze)

test :: TL.Text
test = BT.renderHtml [blaze|



Hello!



|]
```

```
> test
"

Hello!

"
```

This can play well alongside server-side web frameworks such as [HTMX](https://htmx.org/) and [`scotty`](https://hackage.haskell.org/package/scotty).