Closed 1cg closed 2 years ago
Welcome @1cg and thanks for the heads up!
I agree, the current is rather technical, but it offers a lot of possibilities. And it also goes really well with the IntelliJ plugin.
For example, in case you have the same content for two layout slots? You can easily do this:
!{var sameContent = @`<p>Hello there</p>`;}
@template.my.layout(content = sameContent, footer = sameContent)
Or, this content is provided by a Java method? Also works very well:
@template.my.layout(content = page.getContent(), footer = @`foo`)
Changing to a different syntax would be very hard for the plugin to adjust to. Initially jte had very similar layout syntax to what you suggested: https://github.com/casid/jte/blob/f9951d5a4e264a58c831add2b37902ab605fed22/DOCUMENTATION.md#layouts This was changed due to the above limitations and because of in some cases content blocks were needed in non-layout template calls as well.
Would adding an end
or some sort of follow to the syntax help?
It's pretty incredible that you are managing both a template system and an IJ plugin (I am a huge IJ fan). I'm sure the plugin is at least twice the size of the templating code!
oh, wow, this syntax is exactly what I was looking for!
https://github.com/casid/jte/blob/f9951d5a4e264a58c831add2b37902ab605fed22/DOCUMENTATION.md#layouts
If I'm willing to forego a perfect editor experience can I use it?
and, since I'm spamming you anyway, is there a chat system you use for talking about jte? We use discord for htmx:
@1cg no, unfortunately that syntax doesn't work anymore :-)
And no, there's no chat system atm. I'm on discord from time to time, so that might work.
Also, I'm very excited about htmx, once I have a fitting project I'll definitely gonna give it a try together with jte.
That's awesome to hear Andreas. If you have time at some point I would love to chat.
I have a new project bubbling along that is going to bring htmx to the JVM (I am a java developer who has spent a decade in rails) and I like jte the most of all the template systems I have seen. Would love to chat about the project, understand where you are going with it and maybe even contribute if I can be of help.
You can find me on the htmx discord and DM me, or email me at carson at bigsky dot software. Thank you! You can close this issue out if you like!
Thank you! I've sent you a message on discord :-)
Hi There,
Love your templating system! Glad to see someone still innovating in this space too.
Was wondering if you might consider a slightly different layout syntax. Right now we have this:
which makes a ton of sense. But it's a little ugly having to indent the markup like that. What about an alternative syntax that captures the same idea:
I'm not settled on this particular syntax, it's just an example, but the idea is to linearize the content/markup so it's easier to parse visually and you don't have small little back-tics and commas interspersed throughout.