Reputation: 4017
I like how simple Handlebars is and how its design encourages the user to not put logic into the view. I have used it to template things other than HTML, but I am noticing the Handlebars.js website only discusses HTML examples. Is Handlebars only for templating HTML?
My IDE IntelliJ also only syntax checks/highlights my Handlebars files as HTML. I was hoping renaming my handlebars files with the intended extension as secondary (like Question.xml.hbs) would clue IntelliJ into my intentions, but it continued processing like I was editing HTML. There do not appear to be any pragmas in Handlebars for me to indicate what my target format or MIME type should be.
Architecturally, is it bad form to use Handlebars for purposes other than HTML templating? What if I restrict myself to HTML-like languages, like XML?
Upvotes: 3
Views: 1113
Reputation: 8136
Handlebars is used mostly with HTML. But you can change template language for a specified file in the IDEA settings. See:
Update: In the settings you can specify a template language to whole project.
Upvotes: 1