Skip to content

TemplatesLanguageComponentConstructorParams

Parameters for the TemplatesLanguageComponent constructor.

Import:

import type { TemplatesLanguageComponentConstructorParams } from 'obsidian-dev-utils/obsidian/components/templates-language-component';

Signature:

export interface TemplatesLanguageComponentConstructorParams

Properties

PropertyTypeDescription
extraGrammar?Grammar | undefinedExtra top-level entries merged into the built grammar, for a dialect whose templates carry syntax beyond the placeholders themselves — a path separator, say. Omit when there is none.
formatSource?TemplatesLanguageComponentFormatSource | undefinedThe format half of a {{token:format}} placeholder.

Defaults to a scalar word, which is core's own shape.
languagestringThe language to register the grammar as, e.g. my-plugin-template.
tokenPattern?RegExp | undefinedThe characters a token name may contain, anchored at the start of the placeholder body.

Defaults to word characters. A dialect whose token names carry more — a comma-separated argument list, say — widens it here.