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

Examples

open allclose all

Basic Examples  (1)

Loading a template file from disk:

Applying to a FileTemplate:

Saving a template to disk:

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)

File is fully supported:

Templates can be hosted in the Wolfram Cloud:

URL can be used to fetch templates:

URL can be directly used by TemplateApply:

Options  (2)

InsertionFunction  (1)

Specify a function to convert arguments before they are inserted:

You can use a string to specify an export format:

CombinerFunction  (1)

Specify a different way to combine parts of templates:

Properties & Relations  (1)

If you deploy a template with data, each time you visit it TemplateApply will render the content again:

Introduced in 2014
 (10.0)