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

[ bsd3, program, web ] [ Propose Tags ] [ Report a vulnerability ]

HTML parser that pretty prints to a Miso View


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0
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:0.2.0.0
Executables miso-from-html
Downloads 768 total (9 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-0.2.0.0

[back to package description]

miso-from-html

Hackage Haskell Programming Language BSD3 LICENSE Build Status

Convert HTML into miso View syntax.

asciicast

Features

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

Usage

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">
      <a>ok<p>hey</p></a>
    </a>
  </div>
</nav>

Convert it to miso View syntax.

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

Result

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"
		]
	    , a_ []
		[ "ok"
		, p_ [][ "hey" ]
		]
	    ]
	]
    ]

Test

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