The documentation says I just have to install the filters via npm in order to use them.
If you want to be able to use filters in your Pug template, you would first make sure that these features are installed:
$ npm install --save jstransformer-filterNow, you should be able to render the following template:
:markdown-it(linkify) # Markdown
I tried this with highlight.js:
$ npm install --save jstransformer-highlight2
But when I compile the pug file:
:highlight.js(lang='c')
int f(int x) {
return x + 1;
}
I get unknown filter errors:
unknown filter ":highlight"
I checked the filter source code and confirmed the filter's name is highlight.js. I also tried highlight, highlightjs and highlight-js, to no avail.
How do I make this work?
Do I have to pass an option to the pug compiler? The API documentation says it's for custom filters only.