Skip to content

rtfeldman/elm-server-side-renderer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elm-server-side-renderer

Work in process!

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

Packages

No packages published

Languages

  • Elm 94.0%
  • JavaScript 5.8%
  • Shell 0.2%