An open API service indexing awesome lists of open source software.

https://github.com/eeue56/elm-server-side-renderer

Render elm on the server
https://github.com/eeue56/elm-server-side-renderer

Last synced: 19 days ago
JSON representation

Render elm on the server

Awesome Lists containing this project

README

        

# elm-server-side-renderer

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

```elm
> import HtmlToString exposing (htmlToString)
> import Html
> ourDiv = Html.div [ ] [ Html.text "hello world" ]
> htmlToString ourDiv
"

hello world
" : String

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

hello world
" : String

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

hello world
" : String
```