microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.1k stars 793 forks source link

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

Open AJMansfield opened 3 weeks ago

AJMansfield commented 3 weeks ago

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