UNPKG

@vivliostyle/vfm

Version:

Custom Markdown syntax specialized in book authoring.

42 lines (41 loc) 1.51 kB
import { Processor } from 'unified'; import { Metadata } from './plugins/metadata'; import { ReplaceRule } from './plugins/replace'; export * from './plugins/metadata'; /** * Option for convert Markdown to a stringify (HTML). */ export interface StringifyMarkdownOptions { /** Custom stylesheet path/URL. */ style?: string | string[]; /** Output markdown fragments. */ partial?: boolean; /** Document title (ignored in partial mode). */ title?: string; /** Document language (ignored in partial mode). */ language?: string; /** Replacement handler for HTML string. */ replace?: ReplaceRule[]; /** Add `<br>` at the position of hard line breaks, without needing spaces. */ hardLineBreaks?: boolean; /** Disable automatic HTML format. */ disableFormatHtml?: boolean; /** Enable math syntax. */ math?: boolean; } export interface Hooks { afterParse: ReplaceRule[]; } /** * Create Unified processor for Markdown AST and Hypertext AST. * @param options Options. * @returns Unified processor. */ export declare function VFM({ style, partial, title, language, replace, hardLineBreaks, disableFormatHtml, math, }?: StringifyMarkdownOptions, metadata?: Metadata): Processor; /** * Convert markdown to a stringify (HTML). * @param markdownString Markdown string. * @param options Options. * @returns HTML string. */ export declare function stringify(markdownString: string, options?: StringifyMarkdownOptions, metadata?: Metadata): string;