Skip to content

TemplatesLanguageComponentFormatSource

The format half of a {{token:format}} placeholder.

  • A RegExp describes a scalar format — core’s own shape, e.g. the YYYY-MM-DD of {{date:YYYY-MM-DD}} — and is wrapped into a string-aliased token. - A PrismTokenObject describes a structured format, used verbatim, so a dialect whose format half is an object rather than a word can supply its own inside grammar and extent pattern. - A factory is the structured form for a dialect that must nest an already registered Prism language into that inside — it receives the loaded Prism module, so the consumer never calls loadPrism.

Import:

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

Signature:

export type TemplatesLanguageComponentFormatSource

Signature:

type TemplatesLanguageComponentFormatSource = | ((params: SyntaxHighlightingComponentGrammarFactoryParams) => PrismTokenObject)
| PrismTokenObject
| RegExp

Type: | ((params: SyntaxHighlightingComponentGrammarFactoryParams) => PrismTokenObject) | PrismTokenObject | RegExp


Links to this page: