BEMHTML is an XSLT inspired template language that helps to write BEM-oriented templates to generate HTML in a declarative way.
bemhtml library provides:
bemhtmlblock with core templatesbemhtmltech module for use withbem buildcommand of BEM tools to help compiling of templates into JavaScriptbemjson2htmltech module for use withbem createcommand to help building static.htmlfrom static.bemjson.jsand compiled.bemhtml.jsbundle files
The core of BEMHTML compiler is implemented using OmetaJS and xjst.
// Override rendering of `link` block
block link {
// Specify block tag
tag: 'a'
// Specify block html attributes
attrs: {
return { href: this.ctx.url }
}
}