Loaders Classes, Controls, and VIs

Owning Palette: Advanced Classes, Controls, and VIs

Requires: Labstache

Loaders are responsible for loading partial Mustache templates into a root, or master, Mustache template. The Partial tag in a Mustache template acts like an import, or include, where the contents of the particle Mustache template should be added to the Abstract Syntax Tree (AST) of the parsed, root Mustache template. The Mustache template specification does not explicitly define a method for loading, importing, or including partials. The implementation for loading partials is left to the user, but this library provides an abstract base class for creating custom partial loaders and a series of pre-defined loader implementations.

Library ItemDescription
DataThe Data class represents a partial loader that stores partial Mustache templates in a key-value collection and depending on the type for the value, will either load a partial Mustache template from a string or from a file.
FileThe File class represents a partial loader that loads partial Mustache templates stored in a file. This implementation matches the partial loading procedure mentioned in the Mustache template specification. The key for the partial tag is the file name without an extension. A default search path and file extension is used to locate the partial Mustache template file.
LoaderThe Loader class is the abstract base class for all partial loaders. Objects of this class should not be directly created. Instead, a new class that inherints from the Loader class should be created.
StringThe String class represents a partial loader where partial Mustache templates are stored as strings in a key-value collection. The key for the partial tag is the key in the key-value collection and the value is a string containing the partial Mustache template.