CLion 2018.1 Help

Reusable Content in Templates

Include templates are used to define reusable pieces of code (for example, standard headers, copyright statements, and so on) to be inserted in other templates using the #parse directives.

The #parse directive has the following syntax:

#parse("<include_template_name.extension>")

Templates that can be referenced like this in other templates are listed on the Includes tab of the File and Code Templates settings page.

To create an include template:

  1. In the File and Code Templates settings dialog, open the Includes tab.
  2. Click the Create Template button (The Create Template button) on the toolbar and specify the include template name, extension, and body.

To insert a reusable template into another template:

  • Add the #parse directive with the name of the include template that you want to insert. For an example, see template syntax.
Last modified: 30 May 2018