GenerateDocument
GenerateDocument[nb]
generates a document by evaluating all template elements in the notebook nb.
GenerateDocument[nb,args]
generates a document using args to fill template slots.
GenerateDocument[nb,output]
writes the generated document in the output file represented by output.
GenerateDocument[nb,args,output]
uses args to fill template slots and puts the result in output.
Details
- The nb can be a notebook in any of the following forms:
-
"file" or File["file"] explicit file name CloudObject[…] a cloud object LocalObject[…] a local object NotebookObject[…] a NotebookObject Notebook a Notebook expression - GenerateDocument[nb] and GenerateDocument[nb,args] return a notebook object.
- The output in GenerateDocument can be any of the following:
-
"file" or File["file"] explicit file name "!prog" export data to a pipe CloudObject[…] a cloud object LocalObject[…] a local object - GenerateDocument typically works with template notebooks, which can usually be created interactively.
- If the notebook nb does not contain any template elements, GenerateDocument effectively operates like NotebookEvaluate.
- If the notebook nb contains template elements, GenerateDocument will fill template slots from args.
- A positional template slot i is filled from the i position of args.
- A named template slot "name" is filled from an element with key "name" in an association appearing in the first position of args.
- A blank template notebook suitable for use with GenerateDocument can be opened in the front end using CreateNotebook["Template"].
Examples
open allclose allBasic Examples (1)
Scope (1)
Generalizations & Extensions (5)
Generated documents may contain anything notebooks may contain, including interactive elements:
A copy of an interactive section of the generated report:
GenerateDocument can take the input template from a cloud object:
GenerateDocument can generate an output document deployed as a cloud object:
Generate a document as a cloud object with Permissions and MetaInformation:
Deploy a template as a cloud object:
Generate a document locally using the deployed template; deploy the result as a cloud object:
Text
Wolfram Research (2014), GenerateDocument, Wolfram Language function, https://reference.wolfram.com/language/ref/GenerateDocument.html (updated 2020).
CMS
Wolfram Language. 2014. "GenerateDocument." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/GenerateDocument.html.
APA
Wolfram Language. (2014). GenerateDocument. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GenerateDocument.html