question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Layout Syntax Proposal

See original GitHub issue

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:

@import org.example.WelcomePage
@param WelcomePage welcomePage

@template.layout.page(
    page = welcomePage,
    content = @`
        <p>Welcome, ${welcomePage.getUserName()}.</p>
    `,
    footer = @`
        <p>Thanks for visiting, come again soon!</p>
    `
)

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:

@import org.example.WelcomePage
@param WelcomePage welcomePage
@layout template.layout.page(page=welcomePage)

@layout:content
   <p>Welcome, ${welcomePage.getUserName()}.</p>

@layout:footer
  <p>Thanks for visiting, come again soon!</p>

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
1cgcommented, Feb 18, 2022

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!

0reactions
casidcommented, Feb 19, 2022

Thank you! I’ve sent you a message on discord 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout | Apple Developer Documentation
A type that defines the geometry of a collection of views.
Read more >
tc39/proposal-structs: JavaScript Structs: Fixed Layout Objects
This proposal is intended to be minimal. Structs can be designed with or without novel syntax. For brevity of presentation, examples are given...
Read more >
How to Write a Proposal and Get What You Want (Free ...
How to write a proposal: step-by-step · Introduction: A brief overview of the problem, solution, costs, and benefits. · Issue: The main definition ......
Read more >
How to Write a Research Proposal: Structure, Examples ...
A research proposal is commonly written by scholars seeking grant funding for a research project when enrolling for a research-based ...
Read more >
Container Query Proposal & Explainer - OddBird CSS Sandbox
This proposal builds on David Baron's @container approach, which works by applying size & layout containment to the queried elements. Any element with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found