Skip to content

About

Transmutable HTML for Gren

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

A HTML package for Gren.

import Transmutable.Html exposing (Html, html, head, title, body, main_, h1, text)
import Transmutable.Html.Attributes as A (Attribute)

someHtml =
  html
    [ A.lang "en" ]
    [ head
        []
        [ title
            [ text "HTML document" ]
        ]
    , body
        []
        [ main_
            []
            [ h1
                []
                [ text "👋" ]
            ]
        ]
    ]

string =
  Html.toString someHtml

You can also convert this HTML to VirtualDom using this package.

Parsing

import Transmutable.Html as Html

Html.fromString "<html><body><!-- Contents --></body></html>"

Parsers for the individual pieces are available too via the Transmutable.Html.Parser module.

Demo

I've used this for my tokono.ma website, which is a "hybrid" Gren app (both static and dynamic). This package is used there to write static HTML files and render the same HTML templates using Gren's VirtualDom module from the browser package.

Thanks to

This project is based on elm-html-string.

About

Transmutable HTML for Gren

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages