TemplateObject
TemplateObject[expr]
represents a template object to be applied using functions like TemplateApply.
TemplateObject[form,args]
yields a TemplateObject with arguments, suitable for cloud deployment or other evaluation.
Details and Options
- In TemplateObject[expr], the expression expr can contain the follow special elements:
-
TemplateSlot[name] a template slot to be filled when the template is applied TemplateExpression[expr] hold an expression until the template is applied TemplateIf[…] a conditional to evaluate when the template is applied TemplateSequence[…] a sequence to assemble when the template is applied TemplateWith[…] substitutions to make when the template is applied - TemplateObject is generated as the evaluated form of StringTemplate, FileTemplate, XMLTemplate, and NotebookTemplate.
- TemplateObject has the following options:
-
InsertionFunction Inherited function to apply before inserting expressions CombinerFunction Inherited function to apply to combine pieces before returning a result - TemplateObject can be nested, with different options for inner instances.
Examples
open allclose allBasic Examples (1)
Using a TemplateObject:
Nest multiple instances of TemplateObject:
Options (2)
CombinerFunction (1)
InsertionFunction (1)
Neat Examples (1)
You can deploy a TemplateObject to the cloud. When you visit the URL, TemplateApply will render the template on each visit:
Text
Wolfram Research (2014), TemplateObject, Wolfram Language function, https://reference.wolfram.com/language/ref/TemplateObject.html.
CMS
Wolfram Language. 2014. "TemplateObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TemplateObject.html.
APA
Wolfram Language. (2014). TemplateObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TemplateObject.html