litvis icon indicating copy to clipboard operation
litvis copied to clipboard

[WIP] Add html / h block attribute to render static DOM generated by Elm

Open kachkaev opened this issue 7 years ago • 4 comments

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?

kachkaev avatar Jul 15 '18 11:07 kachkaev

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 avatar Jul 16 '18 12:07 folkertdev

@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.

kachkaev avatar Jul 18 '18 15:07 kachkaev

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.

folkertdev avatar Jul 18 '18 15:07 folkertdev

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

rolojf avatar Oct 07 '22 23:10 rolojf