Add template function descriptions

This commit is contained in:
Gregory Schier
2024-10-15 07:47:26 -07:00
parent 17a429525f
commit 9d24aefba1
3 changed files with 3 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import fs from 'node:fs';
export const plugin: PluginDefinition = {
templateFunctions: [{
name: 'fs.readFile',
description: 'Read the contents of a file as utf-8',
args: [{ title: 'Select File', type: 'file', name: 'path', label: 'File' }],
async onRender(_ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null> {
if (!args.values.path) return null;