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

Feature Request: Compacted Double-Braces That Don't Cramp Template-Tag Bodies #749

Open
AJMansfield opened this issue Jun 5, 2024 · 0 comments

Comments

@AJMansfield
Copy link

AJMansfield commented Jun 5, 2024

Description of The New Feature/Enhancement

Several different templating languages and systems use template tags delimited with a double-brace i.e. tags of the form {{template.data}}. As a non-exhaustive list, this includes Jinja templates (including Django page templates and Ansible playbook variables) and Helm charts for kubernetes; but I'm sure I've come across this type of tag delimiter in several other contexts too.

These template languages would be a lot more readable if these doubled braces could be made slightly less 'bulky' so the tails of the inner braces don't visually interfere with the text inside them. This is especially important here as these tags often must be used inline without spaces separating them from preceding or anteceding text.
This visual issue means that in practice a spelling like prefix{{ template.data }}postfix is often used that puts extra space characters inside -- compromising on how easy it is to visually parse a simple tag with delimiters as "the same word". (Also note: the syntax highlighting that these tags get is often unhelpful, since they're often used deep inside YAML or HTML.)

Currently, {{ and }} render as:
current double-brace rendering

I'd propose shifting the position of these characters closer together, something like these image-edited examples:
proposed double-brace rendering

If it's in scope for the same feature request, I'd also propose compacting brace-percent (as used in e.g. Jinja2 {%controlflow%} type tags). Current rendering:
current brace-percent rendering
Image-edited proposal:
proposed brace-percent rendering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant