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

Difference between this and vim-mustache-handlebars? #8

Open
jsit opened this issue Nov 23, 2018 · 4 comments
Open

Difference between this and vim-mustache-handlebars? #8

jsit opened this issue Nov 23, 2018 · 4 comments

Comments

@jsit
Copy link

jsit commented Nov 23, 2018

mustache/vim-mustache-handlebars is the official Vim syntax highlighting/indentation plugin from the Mustache project. What is the advantage to using this over the official one? I wonder if it would be better to take any improvements this has over vim-mustache-handlebars and just incorporate them as PRs there.

@joukevandermaas
Copy link
Owner

I haven't checked recently, but I made this plugin because vim-mustache-handlebars did not support more 'modern' Ember constructs. Instead it seemed to focus on supporting the original handlebars.

I use modern Ember constructs such as contextual components, angle bracket invocation, each-in, {{else if}} etc, which (at least at the time) were not supported by vim-mustache-handlebars and gave strange rendering issues. Using curlies from within attributes (a new feature at the time) also led to very annoying coloring glitches.

Finally, at the time vim-mustache-handlebars did not support automated indentation, which was another good motivation to start this project. I believe they have since merged my PR that added support to their project as well.

I must admit that I have not tried vim-mustache-handlebars since starting this project, so the above may be outdated. However, this works for me and I have not had any reason to switch back. I hope that answers your question.

@jsit
Copy link
Author

jsit commented Nov 23, 2018

Thanks for the detail. Can you please provide some examples of markup that causes the problems you mention? I'd love to get them fixed in the other repo as well. Thanks.

@joukevandermaas
Copy link
Owner

Mostly the example text in the readme is designed to demonstrate the things this support that that doesn't.

@sukima
Copy link
Contributor

sukima commented Mar 16, 2021

Well from a high level mustache and handlebars are a string template syntax while in Ember the template is a LISP language that looks like mustache but isn't.

It includes many differences like nested macro calls

{{foo (bar (baz "frotz"))}}

It has local scoped variables that are yielded

{{#let (something) as |thatThing|}}
  {{log thatThing}}
{{/let}}

Components with yielded values

<FooBar as |theValue|>
  {{log theValue}}
</FooBar>

Soon to have new features like front matter and/or imports, and much much more.

Considering this is a full blown language and not just a string template system it makes sense that it should be approached as a new thing.

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

No branches or pull requests

3 participants