miso-from-html: Convert HTML to miso View syntax

[ bsd3, program, web ] [ Propose Tags ]

HTML parser that pretty prints to a Miso View

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],
Dependencies attoparsec, base (<5), bytestring, containers, pretty-simple, text [details]
License BSD-3-Clause
Copyright (c) David Johnson 2020
Author David Johnson
Maintainer djohnson.m@gmail.com
Category Web
Bug tracker https://github.com/dmjio/miso-from-html/issues
Source repo head: git clone https://github.com/dmjio/miso-from-html.git
Uploaded by DavidJohnson at 2020-05-27T01:24:20Z
Distributions NixOS:
Executables miso-from-html
Downloads 663 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2020-05-27 [all 3 reports]

Readme for miso-from-html-

[back to package description]


Hackage Haskell Programming Language BSD3 LICENSE Build Status

Convert HTML into miso View syntax.



  • Strips comments
  • Pretty prints style tags as a Haskell Map from Data.Map


Given some HTML

<nav class="navbar" role="navigation">
  <div class="navbar-brand">
    <a class="navbar-item" href="https://bulma.io">
      <img src="https://bulma.io/images/bulma-logo.png" width="112" height="28">

Convert it to miso View syntax.

$ cabal run miso-from-html < index.html


    [ class_ "navbar"
    , role_ "navigation"
    [ div_ [ class_ "navbar-brand" ]
	[ a_
	    [ class_ "navbar-item"
	    , href_ "https://bulma.io"
	    [ img_
		[ src_ "https://bulma.io/images/bulma-logo.png"
		, width_ "112"
		, height_ "28"
	    , a_ []
		[ "ok"
		, p_ [][ "hey" ]


$ nix-shell --run 'runghc Main.hs < index.html'