gulp-beman

0.1.0 • Public • Published

gulp-beman

Translate beman templates based on BEM named class structure

Install

$ npm install --save-dev gulp-beman

Usage

var gulp = require('gulp'),
    beman = require('gulp-beman');
 
gulp.src('./src/*.html')
  .pipe(beman({
      elemPrefix: '__',
      modPrefix: '_',
      modDlmtr: '_'
  }))
  .pipe(gulp.dest('./dist'));

You can also use Beman with another template engine, e.g. Jade
Here is an example of such use:

jade template

div(block='animals')
    div(elem='rabbit' mod='type:scurrying, color:white')
    div(elem='dormouse' mod='type:sleeper, color:red')

guplfile.js

gulp.task('jade', function () {
 
    return gulp.src(path.src.jade)
         .pipe(jade({
            pretty: true
          }))
          .pipe(gulp.dest('app/src/'));
});  
gulp.task('html',['jade'], function () {
    return gulp.src(path.src.html)
          .pipe(beman({
            elemPrefix: '__',
            modPrefix: '_',
            modDlmtr: '_'
          }))
          .pipe(gulp.dest(path.build.html));
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i gulp-beman

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • rajdee