13. Templates
fbl0.70.713. Templates
Contents of FBL 0.7
A binding's template is the exact text of a new body. When the user creates a new document of a tool type:
- The host chooses the text:
template.byOrigin[<origin>]when present for the tool type, elsetemplate.text; with a plugin reader and no template, the plugin'stemplateoperation. - It replaces the placeholders, and nothing else:
{name}(the new file's name),{base}(its base name),{key}(the base name with every character outside ASCII letters, digits and_replaced by_, leading and trailing_removed,_prefixed when it then starts with a digit, anduntitledwhen nothing is left), and{newid:<rule>}(a new id made by DISL's strategy for that rule's type).{and}not forming a placeholder are literal. - It writes the file, and a registration when the binding is
registrationOnlyor the document needs one; it MUST NOT overwrite an existing file.
A template MUST read through its binding with no finding of severity warning or above; a validator that can read bindings checks it. The user's first edits are splices into the template's bytes like any others.