Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Haml-like syntax transpiler for Ember HTMLBars templates, installable via npm.
Hbars is a Haml-like syntax transpiler for Ember HTMLBars templates that compiles concise Haml-style markup into HTMLBars template syntax.
Hbars is a Node.js-based transpiler that converts templates written in a Haml-inspired indentation syntax into Ember HTMLBars template files. It takes .hbars source files as input and produces standard HTMLBars markup as output, passing HTMLBars helper logic through with minimal transformation. The project is published on npm and documented at hbars.io, and it also integrates with Ember-cli through the companion ember-cli-hbars addon.
%tag and .class, while using HTMLBars helpers in place of Ruby expressions.npm install --save-dev hbars for direct use in Node.js build processes.ember-cli-hbars package adds Hbars compilation to Ember-cli projects with npm install --save-dev ember-cli-hbars.npm test) for automated testing and includes a grep-style runner (./bin/test 'compiler') to run specific test subsets..hbars files; add au BufNewFile,BufRead *.hbars set filetype=haml to .vimrc.plain: raw text blocks, multi-line attribute lists, HTML doctypes, and data attribute sub-hashes..hbars files for familiar syntax highlighting.Hbars reads .hbars source text and transpiles it to HTMLBars template text. HTMLBars helper expressions embedded in the source are preserved and passed through to the output with minimal rewriting, letting Ember's runtime evaluate them normally.
Install the core package with npm install --save-dev hbars. For Ember-cli projects, also install the addon with npm install --save-dev ember-cli-hbars.
Yes, the ember-cli-hbars addon integrates Hbars compilation into Ember-cli's build pipeline. After installing the addon, .hbars files are processed automatically.
Because Hbars syntax closely matches Haml, you can tell your editor to treat .hbars files as Haml. In Vim, add au BufNewFile,BufRead *.hbars set filetype=haml to your .vimrc.
The project is open to contributions. Its README lists desired features such as raw text blocks with a plain: filter, multi-line attribute lists, HTML doctypes, and data attribute sub-hashes.