UNPKG

mdat

Version:

CLI tool and TypeScript library implementing the Markdown Autophagic Template (MDAT) system. MDAT lets you use comments as dynamic content templates in Markdown files, making it easy to generate and update readme boilerplate.

32 lines (31 loc) 1.68 kB
import { type VFile } from 'vfile'; import { type ConfigToLoad, type RulesToLoad } from './config'; /** * Expand MDAT comments in one or more Markdown files * Writing is the responsibility of the caller (e.g. via `await write(result)`) * @returns an array of VFiles (Even if you only pass a single file path!) */ export declare function expandFiles(files: string | string[], name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>; /** * Expand MDAT comments in a Markdown string */ export declare function expandString(markdown: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>; /** * Check and validate MDAT comments in one or more Markdown files * @returns an array of VFiles (Even if you only pass a single file path!) */ export declare function checkFiles(files: string | string[], name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>; /** * Check and validate MDAT comments in a Markdown string */ export declare function checkString(markdown: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>; /** * Collapse MDAT comments in one or more Markdown files * Writing is the responsibility of the caller (e.g. via `await write(result)`) * @returns an array of VFiles (Even if you only pass a single file path!) */ export declare function collapseFiles(files: string | string[], name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>; /** * Collapse MDAT comments in a Markdown string */ export declare function collapseString(markdown: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>;