UNPKG

markugen

Version:

Markdown to HTML/PDF static site generation tool

38 lines (37 loc) 1.08 kB
import HtmlGenerator from './htmlgenerator'; export declare class Preprocessor { /** * The regular expression used to find the templates */ readonly regex: RegExp; /** * The regular expression used to filter the js code */ readonly filter: RegExp; /** * Instance of the generator */ readonly generator: HtmlGenerator; /** * Variables to define before template expansion */ readonly vars: Record<string, any>; /** * Constructs a new preprocessor with the given variables */ constructor(generator: HtmlGenerator); /** * Expands the given string by replacing template parameters * @param input the string to expand * @param file file being expanded if given one * @returns input expanded and template vars replaced */ process(input: string, file?: string): string; /** * * @param code the code to execute * @param file file being expanded if given one * @returns whatever is returned from the code call */ private safeFunction; }