FileTemplate
FileTemplate["file"]
yields a TemplateObject expression that represents a file template to be applied using functions like TemplateApply.
FileTemplate[src]
uses File[…], URL[…], or CloudObject[…] as the specification for the file location.
FileTemplate[form,args]
yields a TemplateObject with arguments, suitable for cloud deployment or other evaluation.
Details and Options

- FileTemplate will infer from the extension whether to interpret the contents as a StringTemplate, XMLTemplate, or NotebookTemplate.
- FileTemplate[CloudObject[…]] will infer the template type based on the contents of the cloud object.
- FileTemplate[File["path"]] and FileTemplate["path"] are effectively equivalent.
- The following special forms can be used in the file for FileTemplate:
-
`` TemplateSlot[] `n` TemplateSlot[n] `name` TemplateSlot["name"] <*expr*> TemplateExpression[expr] - FileTemplate has the following options:
-
CombinerFunction Automatic function to apply to combine pieces before returning a result InsertionFunction Automatic function to apply before inserting expressions Path $TemplatePath search for templates on the specified path
Examples
open allclose allBasic Examples (1)
Loading a template file from disk:
Applying to a FileTemplate:
The type of template to use is by default determined by the extension:
Evaluate $TemplatePath to see where FileTemplate is searching for templates:
Scope (3)
Options (2)
Properties & Relations (1)
See Also
Related Guides
Related Links
Introduced in 2014
(10.0)