@karmaniverous/jeeves-watcher
    Preparing search index...

    Function buildTemplateEngine

    • Build a TemplateEngine from configuration, pre-compiling all rule templates.

      Parameters

      • rules: {
            description: string;
            map?: JsonMapMap;
            match: Record<string, unknown>;
            name: string;
            render?: {
                body: {
                    contentPath?: string;
                    each?: boolean;
                    format?: string;
                    formatArgs?: unknown[];
                    heading: number;
                    headingTemplate?: string;
                    label?: string;
                    path: string;
                    sort?: string;
                }[];
                frontmatter: string[];
            };
            schema?: (
                | string
                | {
                    properties?: Record<string, Record<string, unknown>>;
                    type?: "object";
                }
            )[];
            template?: string;
        }[]

        The inference rules (may contain template fields).

        • description: string

          Human-readable description of what this rule does.

        • Optionalmap?: JsonMapMap

          JsonMap transformation (inline or reference to named map).

        • match: Record<string, unknown>

          JSON Schema object to match against document metadata.

        • name: string

          Unique name for this inference rule.

        • Optionalrender?: {
              body: {
                  contentPath?: string;
                  each?: boolean;
                  format?: string;
                  formatArgs?: unknown[];
                  heading: number;
                  headingTemplate?: string;
                  label?: string;
                  path: string;
                  sort?: string;
              }[];
              frontmatter: string[];
          }

          Declarative structured renderer configuration (mutually exclusive with template).

          • body: {
                contentPath?: string;
                each?: boolean;
                format?: string;
                formatArgs?: unknown[];
                heading: number;
                headingTemplate?: string;
                label?: string;
                path: string;
                sort?: string;
            }[]

            Ordered markdown body sections.

          • frontmatter: string[]

            Keys to extract from context and include as YAML frontmatter.

        • Optionalschema?: (
              | string
              | { properties?: Record<string, Record<string, unknown>>; type?: "object" }
          )[]

          Array of schema references to merge (named refs and/or inline objects).

        • Optionaltemplate?: string

          Handlebars template (inline string, named ref, or .hbs/.handlebars file path).

      • OptionalnamedTemplates: Record<string, string | { description?: string; template: string }>

        Named template definitions from config.

      • OptionaltemplateHelpers: Record<string, { description?: string; path: string }>

        Custom helper registrations with paths and descriptions.

      • OptionalconfigDir: string

        Directory to resolve relative paths against.

      Returns Promise<TemplateEngine | undefined>

      The configured TemplateEngine, or undefined if no templates are used.