Skip to content

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

Open
kachkaev wants to merge 1 commit intomainfrom
feature/html
Open

[WIP] Add html / h block attribute to render static DOM generated by Elm#4
kachkaev wants to merge 1 commit intomainfrom
feature/html

Conversation

@kachkaev
Copy link
Member

@kachkaev kachkaev commented Jul 15, 2018

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?

@folkertdev
Copy link

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.

@kachkaev
Copy link
Member Author

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

@folkertdev
Copy link

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.

@kachkaev kachkaev changed the base branch from master to main September 5, 2020 21:18
@rolojf
Copy link

rolojf commented Oct 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants