Render elm on the server
Elm JavaScript Shell
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src fix attributes pulling Dec 8, 2016
tests fix attributes pulling Dec 8, 2016
.gitignore add gitignore May 7, 2016
LICENSE Initial commit May 7, 2016
README.md this is not a work in progress, it is done Mar 1, 2017
elm-package.json 🤖 elm-upgrade Dec 7, 2016

README.md

elm-server-side-renderer

Take a Html msg element and turn it into a string.

> import HtmlToString exposing (htmlToString)
> import Html
> ourDiv = Html.div [ ] [ Html.text "hello world" ]
> htmlToString ourDiv
"<div>hello world</div>" : String


> import Html.Attributes exposing (class)
> ourDiv = Html.div [ class "donkey" ] [ Html.text "hello world" ]
> htmlToString ourDiv
"<div class=\"donkey\">hello world</div>" : String


> import Html.Attributes exposing (class, style)
> ourDiv = Html.div [ class "donkey", style [ ("color", "red") ] ] [ Html.text "hello world" ]
> htmlToString ourDiv
"<div class=\"donkey\" style=\"color:red\">hello world</div>" : String