HTMLTemplate Parser
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 --helpUsage: 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
, (defaultfalse
) – do not attempt to parse HTML tags, treat them as text,reducePositionLookups
, (defaultfalse
) – do not calculate line, column and offset for most nodes, this would speedup parsing of large files.
Example usage
var fs = ;var inspect = inspect; var parser = ; var tmpl = fs;var ast = parser; console;