I'm trying to generate a JSP page, and since the template delimiters used by JSP's are the same as the ones used by underscore.
looking at the docs --> https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-setDelimiters i can see they have a function for that
grunt.template.addDelimiters(name, opener, closer)
Two questions:
grunt.template.process()
( i have more than one, and for other non .jsp templates, the default delimiters are fine ) ?Any help is appreciated. Thanks.
from the documentation for grunt.template.process:
The default template delimiters are <% %> but if options.delimiters is set to a custom delimiter name, those template delimiters will be used instead.
that basically would mean that you can call grunt.template.process with the name of the delimiter you added before.
e.g. if you want to use square-brackets as delimiters in one processing step that should do the job:
// first add the new delimiters which you want to use
grunt.template.addDelimiters('square-brackets', '[', ']');
// and use it
grunt.template.process(template, {delimiters: 'square-brackets'});
// and use it with the default delimiters (named 'config')
grunt.template.process(template);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With