@meldscience/meld
Version:
pipeable one-shot prompt scripting toolkit
26 lines (25 loc) • 906 B
TypeScript
/**
* extractPlaceholders.ts
*
* Extracts placeholders from a markdown file.
* Placeholders can be:
* - @cmd[command] - Execute a command
* - @import[file.md#heading] - Import a section from a markdown file
* - @import[file.ts:symbol] - Import a symbol from a code file
* - @import[file.ts:symbol1,symbol2] - Import multiple symbols from a code file
* - @import[file.md#heading as h2] - Import with heading level override
* - @import[file.md#heading as h2 "New Title"] - Import with heading level and text override
*/
export interface Placeholder {
type: 'cmd' | 'import';
raw: string;
lineNumber: number;
command?: string;
importPath?: string;
heading?: string;
importSymbol?: string;
importSymbolList?: string[];
headingLevelOverride?: string;
headingTextOverride?: string;
}
export declare function extractPlaceholders(content: string): Placeholder[];