gulp-batman-templates
v0.0.1
Published
Turn HTML files into JS code to preload batman.js templates
Downloads
5
Maintainers
Readme
gulp-batman-templates
This is gulp port of davemo/grunt-batman-templates. Bravo to him for thinking this up.
Example:
Lets say you have some .jade
files that you want to preload in your batman.js app:
var gulp = require('gulp');
var concat = require('gulp-concat');
var jade = require('gulp-jade');
var batmanTemplates = require("./public/batman/gulp-batman-templates")
gulp.task("html", function(){
gulp.src(["./public/batman/html/**/*.jade"]) // Load the .jade files
.pipe(jade()) // Convert to HTML and
.pipe(batmanTemplates()) // Convert to JavaScript for Batman.HTMLStore
.pipe(concat('templates.js')) // Join all into one file
.pipe(gulp.dest("./public/batman/build/")) // Spit that file out!
})
Now, make sure templates.js
is included in your app:
<script src='/path/to/batman.js'></script>
<script src='/path/to/my_app.js'></script>
<script src='/path/to/templates.js'></script>
You're done!