0.3.0 • Published 9 years ago

gulp-oswst v0.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

OSWS Templates gulp plugin 0.3.0

gulp-osws-templates

GitHub version npm version Build Status

For oswst@0.3.0.

Usage

template.js

var T = require('oswst');

with(T.with) {
    module.exports = div()('<%= name? name : "undefined" %>')
}

gulpfile.js

var gulp = require('gulp');
var oswst = require('gulp-oswst');

gulp.task('templates', function() {
    gulp.src('./template.js')
    .pipe(oswst({
        context: { name: 'OSWS' }
    }))
    .pipe(gulp.dest('./'));
});
<div>OSWS</div>

TOptions

context

{ name: string: TContext };

arguments

Array;

handler

(template: Function, options: TOptions, file: GulpFile, callback: (result: string) => void)

Handle any file.

template.js

var T = require('oswst');

with(T.with) {
    module.exports = div()('<%= name? name : "undefined" %>')
}

gulpfile.js

var gulp = require('gulp');
var oswst = require('gulp-oswst');

gulp.task('templates', function() {
    gulp.src('./template.js')
    .pipe(oswst({
        context: { name: 'OSWS' },
        arguments: [1, 2, 3],
        
        // default handler
        handler: function(template, options, file, callback) {
    		Templates.Module(template)
    		.apply(null, options.arguments)
    		.render(callback, options.context);
        }
    }))
    .pipe(gulp.dest('./'));
});
0.3.0

9 years ago

0.3.0-beta.29

9 years ago

0.3.0-beta.24

9 years ago

0.3.0-beta.23

9 years ago

0.3.0-beta.22

9 years ago

0.3.0-beta.21

9 years ago

0.3.0-beta.20

9 years ago

0.3.0-beta.19

9 years ago

0.3.0-beta.18

9 years ago

0.3.0-beta.17

9 years ago

0.3.0-beta.16

9 years ago

0.3.0-beta.15

9 years ago

0.3.0-beta.14

9 years ago

0.3.0-beta.13

9 years ago

0.3.0-beta.12

9 years ago

0.3.0-beta.11

9 years ago

0.3.0-beta.10

9 years ago

0.3.0-beta.9

9 years ago

0.3.0-beta.8

9 years ago

0.3.0-beta.7

9 years ago

0.3.0-beta.6

9 years ago

0.3.0-beta.5

9 years ago

0.3.0-beta.4

9 years ago

0.3.0-beta.3

9 years ago

0.3.0-beta.2

9 years ago

0.3.0-beta

9 years ago