Skip to content

TemplaterActiveFileProvider

Active-file provider that answers with the file a parseTemplate render is currently for, falling back to the workspace’s active file when no render is in flight.

This is the piece that makes a consumer’s own template helpers resolve against the right note: during a render the workspace still has whatever the user was looking at open, which is rarely the target.

Import:

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

Signature:

export class TemplaterActiveFileProvider extends AppActiveFileProvider

Extends: AppActiveFileProvider

Methods

MethodReturnsDescription
getActiveFile()null | TFileGets the file the innermost in-flight parseTemplate render is for, or the workspace's active file when there is no render in flight.

Links to this page: