gulp-bemjson
v0.1.2
Published
Gulp plugin for process bemjson to html
Downloads
4
Maintainers
Readme
gulp-bemjson
Process BEMJSON to HTML with BH
Install
$ npm install --save-dev gulp-bemjson
Usage
// gulpfile.js
var gulp = require('gulp');
var bemjson = require('gulp-bemjson');
gulp.task('default', function () {
return gulp.src('src/index.bemjson.js', { read: false })
.pipe(bemjson())
.pipe(gulp.dest('dist'));
});
//page.bemjson.js
module.exports.bemjson = {
block: 'page',
tag: 'html',
content: {
elem: 'body',
tag: 'body',
content: 'Hello!'
}
};
With some BH templates, which applies for this file only:
//page.bemjson.js
module.exports.bemjson = {
block: 'page',
content: {
elem: 'body',
content: 'Hello!'
}
};
module.exports.bh = function(bh) {
bh.match('page', function(ctx, json) {
ctx.tag('html');
return [
'<!doctype html>',
json
];
});
};
What is it BEM?
License
MIT © Dmitry Kokorev