TemplateData
interfaceinterface TemplateDataTemplate data model passed to Eta per-item templates as it.
PROPERTIES
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| description? | string | Example description |
| files | ExampleFile[] | Example files |
| helpers | { codeBlock: (contents: string, language?: string, attributes?: Record<string, string>) => string; createFileAccessor: (file: ExampleFile, title?: string) => FileAccessor; filesByExt: (files: ExampleFile[], ext: string) => ExampleFile[]; hunkDescription: (metadata: Record<string, unknown>, hunkId: string) => string | undefined; isProseFile: (file: ExampleFile) => boolean; langFromPath: (filePath: string) => string; region: (files: ExampleFile[], regionId: string) => { content: string; file: ExampleFile } | undefined; slugify: (text: string) => string } | Template helper functions |
| id | string | Example unique identifier |
| metadata | Record<string, unknown> | Full metadata object |
| renderedProse | string[] | Prose files rendered through Eta (with file/region helpers expanded) |
| title | string | Example title |
| unconsumedFiles | ExampleFile[] | Files not consumed by prose helpers β the "remaining" code files |