litvis
litvis copied to clipboard
[WIP] Add html / h block attribute to render static DOM generated by Elm
TODO: figure out how we can use native div, p, etc. functions something like toHtml (like we do with specs using toVegaLite).
Thought: Should we reserve h / html for printing raw HTML like we do in case of j / json and use something like d / dom when rendering Elm DOM?
It would be great to have html render support. Are you aware of eeue56/elm-static-html-lib? It's a great package by Noah that renders elm apps (given a model) to static html strings.
@folkertdev we are currently executing Elm code with run-elm, which returns us serialized data rather than executable JS functions. I guess that elm-static-html-lib expects the latter, but feel free to correctly if I'm wrong.
The result of elm-static-html-lib is an html string (Html.p [] [ text "some text"] => <p>some text</p>)
It's pretty flexible so if that stringification of html is something you want then this is the way in 0.18.
I assume this will all be easier once the compiler supports server-side rendering, but that seems delayed for a while. May make sense to ask Evan and Noah what the plans are in this area first.
I am sorry, I can't help with this. I not as smart.
It would be great to have this working.
Trying to draw some things using ianmackenzie/elm-3d-scene and svg's.
Thanks