@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
42 lines (41 loc) • 1.61 kB
TypeScript
import { Item } from '@pkg/md/parser/item';
import { Iterator } from '@pkg/md/parser/pagelexer';
import { Shortcode } from "@internal/domain/markdown";
export declare class ShortcodeImpl implements Shortcode {
name: string;
params: string[] | Record<string, any> | null;
pos: number;
length: number;
rawContent: string;
placeholder: string;
inline: boolean;
closed: boolean;
inner?: string | any[];
ordinal: number;
indentation?: string;
doMarkup: boolean;
isClosing: boolean;
info?: any;
templs?: any[];
constructor(ordinal?: number, name?: string, params?: string[] | Record<string, any> | null, pos?: number, length?: number, inline?: boolean, closed?: boolean);
needsInner(): boolean;
}
export declare class ShortcodeParser {
private shortcodes;
private nameSet;
private source;
private ordinal;
private pid;
private openShortcodes;
private paramElements;
constructor(source: Uint8Array, pid?: number);
parseItem(item: Item, iter: Iterator): Shortcode;
private extractShortcode;
getShortcodes(): Shortcode[];
getNames(): string[];
}
export declare const TOC_SHORTCODE_PLACEHOLDER: string;
export declare const SHORTCODE_PLACEHOLDER_PREFIX = "HAHAHUGOSHORTCODE";
export declare function createShortcodePlaceholder(id: string, sid: number, ordinal: number): string;
export declare function hasShortcodePlaceholder(content: string): boolean;
export declare function replaceShortcodePlaceholders(content: string, shortcodes: Shortcode[], renderer: (shortcode: Shortcode) => string): string;