Skip to content

parseTemplate

Renders a Templater template against a target file and returns the resulting text, without writing anything.

For the duration of the call getTemplaterRenderTargetFile and TemplaterActiveFileProvider report targetPathOrFile, so a consumer’s own helpers invoked from inside the template resolve against it rather than against whatever the user has open.

Import:

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

Signature:

function parseTemplate(params: ParseTemplateParams): Promise<string>

Parameters:

ParameterTypeDescription
paramsParseTemplateParamsThe ParseTemplateParams.

Returns: Promise<string> — A Promise resolving to the rendered text.


Links to this page: