Skip to content

TemplaterRunMode

Templater’s RunMode enum, which says what kind of render a TemplaterRunningConfig describes.

The numeric values ARE Templater’s, and the members are listed in its declaration order so the two can be compared line for line. They are written out explicitly all the same, because they cross into Templater as integers — never renumber them.

Import:

import type { TemplaterRunMode } from 'obsidian-dev-utils/obsidian/templater';

Signature:

export enum TemplaterRunMode

Members:

MemberValueDescription
CreateNewFromTemplate0Render the template into a newly created file.
AppendActiveFile1Render the template and append the result to the active file.
OverwriteFile2Render the template and overwrite a given file with the result.
OverwriteActiveFile3Render the template and overwrite the active file with the result.
DynamicProcessor4Render the template on demand, for a caller that wants the resulting text rather than a file written. This is what parseTemplate uses.
StartupTemplate5Render the template as a startup template. getTemplaterFunctions uses it for the throwaway config it builds, because that config renders nothing.

Links to this page: