UNPKG

@mdfriday/foundry

Version:

The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.

29 lines (28 loc) 1.13 kB
import { ItemType, Items } from './item'; import { Config, Iterator } from './pagelexer'; export interface Result { Iterator(): Iterator; Input(): Uint8Array; } export declare function ParseBytes(b: Uint8Array, cfg: Config): [Items, Error | null]; export declare function ParseBytesMain(b: Uint8Array, cfg: Config): [Items, Error | null]; export interface ContentFrontMatter { Content: Uint8Array; FrontMatter: { [key: string]: any; }; FrontMatterFormat: Format; } export declare enum Format { JSON = "json", ORG = "org", TOML = "toml", YAML = "yaml", UNKNOWN = "" } export declare function ParseFrontMatterAndContent(input: Uint8Array): Promise<[ContentFrontMatter, Error | null]>; export declare function FormatFromFrontMatterType(typ: ItemType): Format; export declare function ParseMain(input: Uint8Array, cfg: Config): [Result, Error | null]; export declare function IsProbablySourceOfItems(source: Uint8Array, items: Items): boolean; export declare function HasShortcode(s: string): boolean; export declare function collectStringMain(input: string): [Items, Error | null];