gulp-freemarker-axd

0.0.7 • Public • Published

gulp-freemarker-axd

freemarker plugin for gulp

Usage

First, install gulp-freemarker-axd as a development dependency:

npm install --save-dev gulp-freemarker-axd

Then, add it to your gulpfile.js:

var freemarker = require("gulp-freemarker-axd");
 
gulp.src("./mock/*.json")
    .pipe(freemarker({
        viewRoot: "WEB-INF/views/",
        options: {},
        globalData:"",
        directiveUrl:""
    }))
    .pipe(gulp.dest("./www"));

You should provide mock files, which type is json:

{
    "file": "hello.ftl",
    "data": {
        "name": "World"
    }
}
  • file is relative to viewRoot, gulp-freemarker-axd will read and process ${viewRoot}/${file} file.

  • data is the data model the template required.

API

freemarker(options)

options.viewRoot

Type: String Required: true

The directory where all templates files in.

options.options

Type: Object Default: {}

Options for Freemarker.js. see also https://github.com/ijse/freemarker.js#configurations.

License

MIT License

Package Sidebar

Install

npm i gulp-freemarker-axd

Weekly Downloads

2

Version

0.0.7

License

MIT

Last publish

Collaborators

  • lxlneo