2.1.0 • Published 6 years ago

htmltemplate-parser v2.1.0

Weekly downloads
119
License
MIT
Repository
github
Last release
6 years ago

HTMLTemplate Parser

TravisCI

HTML::Template-like templating language parser, that can parse a pragmatic subset of HTML/TMPL tag combinations (see #1) and Perl expressions.

Installation

npm install htmltemplate-parser

CLI

$ htmltemplate-parser --help
Usage: htmltemplate-parser [options]

Options:
  --path         file to parse                               [string] [required]
  --pretty       output with colors                                    [boolean]
  --ignore-html  treat HTML tags as text                               [boolean]

JavaScript API

parse(string, options) method

Parse the supplied template string and return the corresponding AST. Available options:

  • ignoreHTMLTags, (default false) – do not attempt to parse HTML tags, treat them as text,
  • reducePositionLookups, (default false) – do not calculate line, column and offset for most nodes, this would speedup parsing of large files.

Example usage

var fs = require('fs');
var inspect = require('util').inspect;

var parser = require('htmltemplate-parser');

var tmpl = fs.readFileSync('./example.inc', 'utf8');
var ast = parser.parse(tmpl);

console.log(inspect(ast, { colors: true, depth: Infinity }));
2.1.0

6 years ago

2.0.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.4.5

8 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago