David
David
> Would it be possible to change the use of Attr.addTo(Tag, ShortForm) to something like tag.with(ShortForm)? I currently can't figure out how to get the generics to work and changing...
Sorry @mwanji, it's been a busy weekend. The current philosophy was just to keep things simple. Writing detailed rules for each tag by hand seemed like a pain to maintain,...
@mwanji Do you want to move forward with this?
That's fine, I was just cleaning up and wondering if I should keep the PR open. Take your time.
Can you show me your code? The more idiomatic way to write it would probably be `tag.withClasses("a", "b", iff(true, "c"))`
@h2software can you show me a bigger code example where you want to use this? I understand the simple cases, but I really think you should use `tag.withClasses("nav", iff(isActive, "active"))`...
@h2software there isn't a lot of j2html in your example, but I understand why you want the method. I really want to nudge people towards a more declarative programming style...
> If withClass would append rather than replace, that would be consistent with your other with methods, though. For example tr().with(td()).with(td()) would add two data cells, not one. Well, damn....
> Please don't change the behaviour of the with methods, they are so useful as they are. I won't change it anytime soon. I would need to run a survey...
@QuintinWillison do you think `withX`'s behavior should depend on the targeted attribute?