Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag class per HTML element #116

Closed
mkopylec opened this issue May 17, 2018 · 7 comments
Closed

Tag class per HTML element #116

mkopylec opened this issue May 17, 2018 · 7 comments

Comments

@mkopylec
Copy link

The API of j2html would become much more type safe if every HTML element had each own representation class that extends either ContainerTag or EmptyTag. Each HTML element class could then have each own set of predefined HTML attributes.
Working with that kind of API would be much more comfortable, but it is quite a lot of work to implement it in j2html. Is there any chance to provide such API or maybe you are open for pull request?

@tipsy
Copy link
Owner

tipsy commented May 17, 2018

@mkopylec I'm always open to pull requests. This change would massively increase the codebase, so please start with a small proof of concept that can be reviewed first.

Edit: Accidentally sent before I finished writing.

@mkopylec
Copy link
Author

The amount of code will surely increase, but users of the library will have a lot nicer API to use.
I will create a small PoC.

@mkopylec
Copy link
Author

Check out #117

@mwanji
Copy link
Contributor

mwanji commented Jun 28, 2018

This is interesting! I created my own PoC, using JavaPoet to generate the code: #121

@ghost
Copy link

ghost commented Oct 17, 2019

@mkopylec There are other APIs providing such features (including htmlFlow), maybe j2html's developers prefer keeping it simple.

@mkopylec
Copy link
Author

@gouessej It looks promising, thanks.

@ghost
Copy link

ghost commented Oct 19, 2019

@mkopylec You're welcome. Feel free to try my flowifier, I've just tested against Wikipedia's homepage, it helps to generate some Java source code from existing HTML source code.

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

No branches or pull requests

3 participants