2.1.3 • Published 8 years ago

htmltemplate-transform v2.1.3

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

HTMLTemplate transformations

TravisCI

Pluggable transforms for HTML::Template.

Installation

npm install htmltemplate-transform

Usage

var path = require('path');
var transform = require('htmltemplate-transform');

// Plugin that inlines external template files into parent.
var include = require('htmltemplate-transform/plugins/include');

// Plugin that expands dot notation into a series of property accessors.
var jpath = require('htmltemplate-transform/plugins/jpath');

var templateFile = path.join(__dirname, 'template.tmpl');

var ast = transform(templateFile)
    .using(
        include({
            includeTags: ['TMPL_INCLUDE'],
            resolvePath: function(tagname, from, to) {
                return path.resolve(path.dirname(from), to);
            }
        })
    )
    .using(jpath()) // Plugins can be chained.
    .toAST();

console.log(ast);
2.1.3

8 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago