{"id":19079391,"url":"https://github.com/georgefst/prettyprinter-lucid","last_synced_at":"2026-02-13T03:12:01.318Z","repository":{"id":56875387,"uuid":"287996945","full_name":"georgefst/prettyprinter-lucid","owner":"georgefst","description":"Pretty HTML from Haskell.","archived":false,"fork":false,"pushed_at":"2025-03-06T11:55:09.000Z","size":35,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-23T05:57:18.675Z","etag":null,"topics":["html","prettyprinter"],"latest_commit_sha":null,"homepage":"http://hackage.haskell.org/package/prettyprinter-lucid","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgefst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-16T17:59:55.000Z","updated_at":"2025-03-06T11:55:12.000Z","dependencies_parsed_at":"2024-09-15T00:06:39.580Z","dependency_job_id":"926d0b5e-7158-4998-af1f-b89d239e55ef","html_url":"https://github.com/georgefst/prettyprinter-lucid","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"5bbbbe579da1c3095515dde3c06109fec57c891e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/georgefst/prettyprinter-lucid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgefst%2Fprettyprinter-lucid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgefst%2Fprettyprinter-lucid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgefst%2Fprettyprinter-lucid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgefst%2Fprettyprinter-lucid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgefst","download_url":"https://codeload.github.com/georgefst/prettyprinter-lucid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgefst%2Fprettyprinter-lucid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261429509,"owners_count":23157045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","prettyprinter"],"created_at":"2024-11-09T02:14:34.483Z","updated_at":"2026-02-13T03:12:01.276Z","avatar_url":"https://github.com/georgefst.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pretty HTML\n\nThis is just a tiny library enabling [lucid](https://hackage.haskell.org/package/lucid) to be used as a backend for [prettyprinter](https://hackage.haskell.org/package/prettyprinter). This makes it easy to programmatically generate HTML documents with complex nested styling.\n\n# Example\n\nThis code, adapted from `prettyprinter`'s main example, produces the following:\n\n![png](./doc/example.png)\n\n```hs\n{- cabal:\nbuild-depends: base, text, lucid, prettyprinter, prettyprinter-lucid\n-}\n{-# LANGUAGE GHC2021 #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# OPTIONS_GHC -Wall #-}\n\nmodule Main (main) where\n\nimport Data.Text (Text)\nimport Lucid\nimport Lucid.Base\nimport Prettyprinter\nimport Prettyprinter.Lucid\nimport Prettyprinter.Render.Util.SimpleDocTree (treeForm)\n\nmain :: IO ()\nmain = renderToFile \"example.html\" $ render 20 doc\n\nrender :: Int -\u003e Doc (Html () -\u003e Html ()) -\u003e Html ()\nrender width' =\n    div_ [style \"background-color: #1F1F1F; padding: 0.2rem; padding-left: 0.4rem\"]\n        . renderHtml\n        . treeForm\n        . layoutPretty\n            defaultLayoutOptions{layoutPageWidth = AvailablePerLine width' 1}\n\ndoc :: Doc (Html () -\u003e Html ())\ndoc =\n    annotate (span_ [style \"font-weight: bold\"]) $\n        prettyprintDeclaration\n            \"example\"\n            [\"Int\", \"Bool\", \"Char\", \"IO ()\"]\n  where\n    prettyprintDeclaration n tys =\n        colour \"#DCDCAA\" (pretty @Text n) \u003c+\u003e prettyprintType tys\n    prettyprintType =\n        align\n            . sep\n            . zipWith (\u003c+\u003e) (map (colour \"#CC524B\") $ \"::\" : repeat \"-\u003e\")\n            . map (colour \"569CD6\")\n    colour c =\n        annotate (span_ [style $ \"color: \" \u003c\u003e c])\n\nstyle :: Text -\u003e Attribute\nstyle = makeAttribute \"style\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgefst%2Fprettyprinter-lucid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgefst%2Fprettyprinter-lucid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgefst%2Fprettyprinter-lucid/lists"}