tipsy / j2html

Java to HTML generator. Enjoy typesafe HTML generation.
https://j2html.com/
Apache License 2.0
765 stars 136 forks source link

Parse html to j2html tool #123

Open ijabz opened 6 years ago

ijabz commented 6 years ago

An idea, in many cases I can imagine people retrofitting their code to use j2html rather than their previous method. I have html created without j2html, it would be great if i could pass some rendered html which would then generate the j2html java code needed to create it from j2html instead.

tipsy commented 6 years ago

Yes, this is the reason it's a bad fit for bootstrap, since you need to convert a lot of html to j2html. There was an issue for creating a conversion tool a few years back, but no one seemed interested in working on it.

tipsy commented 6 years ago

This might be helpful: https://github.com/ArthurClemens/mithril-template-converter/tree/master/packages/mithril-template-builder

Live demo: http://arthurclemens.github.io/mithril-template-converter/index.html

rupert-madden-abbott commented 6 years ago

I came up with this, this evening. It's very basic but functional. Posting here in case it is useful to others: https://github.com/rupert654/j2html-generator

tipsy commented 6 years ago

Nice work rupert! It would be nice to have a JavaScript version that could be run in the browser, but I suppose I could create a web service for it.