PyCharm 2.7 Web Help

You can include a variable or a directive in your file template but suppress expanding it by PyCharm on template applying. Just prepend the $ or # symbol for variable or directive respectively with a backslash '\' character. The Velocity engine will exclude the symbol from processing according to Velocity escaping rules for file templates.

No backslash is required if a variable or directive itself contains any symbols that prevent the Velocity engine from treating it as a Velocity variable or directive. Such characters are, for example, dots, interrogation marks, quotes, double quotes, etc. see the Velocity notation for details.

Examples of applying Velocity escaping rules for file templates:

  • To use a $SINGLE_VARIABLE_IDENTIFIER_WITH_NO_DOTS, prepend it with a backslash: \$SINGLE_VARIABLE_IDENTIFIER_WITH_NO_DOTS
  • To use a #SINGLE_DIRECTIVE_WITH_SINGLE_SCRIPT_ELEMENT, prepend it with a backslash: \#SINGLE_DIRECTIVE_WITH_SINGLE_SCRIPT_ELEMENT.

    Note

    For details on escaping directives with multiple script elements inside, see Velocity guide.

  • To use a $SINGLE.VARIABLE.IDENTIFIER.WITH.DOTS no backslash is required. The engine will not treat such expression as a variable to be processed because a Velocity variable cannot contain dots according to the Velocity variable notation.
  • To use some version control keywords (such as $Revision$, $Date$, etc.) in your default class template, prepend them with a backslash: \$Revision$.

See Also

Concepts:

Procedures:

Reference:

Web Resources: