BEMHTML is an XSLT inspired template language that helps to write BEM-oriented templates to generate HTML in a declarative way.
bemhtml
library provides:
bemhtml
block with core templatesbemhtml
tech module for use withbem build
command of BEM tools to help compiling of templates into JavaScriptbemjson2html
tech module for use withbem create
command to help building static.html
from static.bemjson.js
and compiled.bemhtml.js
bundle 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 }
}
}