hledger-lib-1.52.1: A library providing the core functionality of hledger

Safe Haskell | None
Language | GHC2021

Hledger.Write.Html

Description

HTML writing helpers. This module would ideally hide the details of which HTML library is used, but it doesn't yet.

Currently hledger-web uses blaze-html, but hledger CLI reports use lucid. lucid has a more usable API than blaze-html (https:/chrisdone.composts/lucid). lucid2's is even better. Unfortunately lucid* can not render multi-line or indented text. We want this so that humans can read and troubleshoot our HTML output. So a transition to blaze-html may be coming.

Synopsis

- toHtml :: forall (m :: Type -> Type). (ToHtml a, Monad m) => a -> HtmlT m ()
- type Html = Html ()
- formatRow :: Lines border => [Cell border Html] -> Html
- htmlAsText :: Html -> Text
- htmlAsLazyText :: Html -> Text
- styledTableHtml :: Lines border => [[Cell border Html]] -> Html
- tests_Hledger_Write_Html :: TestTree

# Documentation

toHtml :: forall (m :: Type -> Type). (ToHtml a, Monad m) => a -> HtmlT m () Source #

Convert to HTML, doing HTML escaping.

type Html = Html () Source #

formatRow :: Lines border => [Cell border Html] -> Html Source #

htmlAsText :: Html -> Text Source #

htmlAsLazyText :: Html -> Text Source #

styledTableHtml :: Lines border => [[Cell border Html]] -> Html Source #

Export spreadsheet table data as HTML table. This is derived from https://hackage.haskell.org/package/classify-frog-0.2.4.3/src/src/Spreadsheet/Format.hs

tests_Hledger_Write_Html :: TestTree Source #