Popularity
4.1
Growing
Activity
0.0
Stable
10
2
1

Monthly Downloads: 5
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Web     Miso    

miso-from-html alternatives and similar packages

Based on the "miso" category.
Alternatively, view miso-from-html alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of miso-from-html or a related project?

Add another 'miso' Package

README

miso-from-html

Hackage Haskell Programming Language BSD3 LICENSE Build Status

Convert HTML into miso View syntax.

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'


*Note that all licence references and agreements mentioned in the miso-from-html README section above are relevant to that project's source code only.