A method for quickly adding export templates follows that for built-in Prototypes. A File menu item displays a sub-menu of built-in export templates that can be added to the current document.
If no templates already exist, a root-level container 'Templates' is added. The 'Templates' container's $OnAdd is set to $IsTemplate = true
.Also the built-in prototype 'HTML Template' is added to the existing built-in Prototypes container or the latter container is also added. If a 'Templates' and/or 'Prototypes' container exists these are used for any newly added notes instead of creating new containers.
The offered built-in templates are:
- HTML Page. HTML5 page export, with includes. This inserts two templates in the form of a wrapper template - applied to the main note to export - which then recursively calls a per-item template to include all the main page's descendants. The item template is inserted as a child of the wrapper, emphasising the usage.
- OPML. OPML export, with includes. This inserts two templates in the form of a wrapper template - applied to the main note to export - which then recursively calls a per-item template to include all the main page's descendants. The item template is inserted as a child of the wrapper, emphasising the usage.
- Scrivener. OPML export, with includes. Same as the above but in place to aid Scrivener users and easy branching for an possible Scrivener-only variations.
Once templates are added the user can modify the template code.