-
Notifications
You must be signed in to change notification settings - Fork 225
Document template comment syntax #273
Copy link
Copy link
Closed
Description
Sometimes it's useful to put a comment into a template that is intended for template maintainers, and should not be included in the generated output.
It took a bit of searching around through StringTemplate documentation and experimentation to find a comment syntax that works: wrapping comments between $! and !$.
For example:
$! This comment won't appear in the output !$
// This comment will appear in the output
$!
This multiline comment won't appear either
No matter how
long it is
Internal $substitutions$ are ignored.
Even $invalid$ ones.
!$
/*
* This comment is output and can contain $substitutions$
*/
If you generate using substitutions=variables that get substituted when the template is applied, results in:
// This comment will appear in the output
/*
* This comment is output and can contain variables that get substituted when the template is applied
*/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels