See documentation on our wiki.
The library is a UMD-module that support browsers, AMD and Node.js.
For simplest case in HTML, include using <script>
tags:
<script type="text/javascript" src="waterpipe.js"></script>
waterpipe('The value is {{value}}.', { value: 1 }); // The value is 1.
Defines global variables readable in this evaluation.
Variables declared here will override those in waterpipe.globals
.
Sets indentation of resulting HTML markup.
Each level of nested elements will be indented by the specfied number of spaces or the specific sequence of characters.
If either 0
or an empty string is specified, indentation is turned off as if this option is absent.
Number of spaces or the specific sequence of characters that will be left padded to each line.
This option is only effective if the indent option is present and not equal to 0
or an empty string.
Suppress encoding reserved HTML characters, including '
, "
, &
, <
and >
.
When set to false
, all HTML features such as encoding reserved HTML characters, indentation, malformed tag and attribute completions will be turned off.
Useful for templates that is not for generating HTML content.
Default is true
.