UNPKG

markdown-it-caml

Version:

Add caml (semantic) attribute syntax for markdown-it.

36 lines (35 loc) 1.28 kB
/// <reference types="markdown-it" /> import MarkdownIt from 'markdown-it/lib'; import MarkdownIt$0 from "markdown-it"; // option types interface OptAttr { enable: boolean; render: boolean; } interface OptCssNames { attr: string; wiki: string; invalid: string; reftype: string; doctype: string; attrbox: string; attrItem: string; } interface CamlOptions extends MarkdownIt$0.Options { // metadata functions addAttr?: (env: any, key: string, value: string) => void; // render opts attrs: OptAttr; cssNames: OptCssNames; // wiki value rendering — mirrors the markdown-it-wikirefs resolvers (env-first) // so caml renders wiki attr values as <a> links standalone; override to match // the co-installed wikirefs. NOTE: when markdown-it-wikirefs is co-registered, // caml delegates wiki attr values to it and these are unused. resolveHtmlHref?: (env: any, fname: string) => string | undefined; resolveHtmlText?: (env: any, fname: string) => string | undefined; resolveDocType?: (env: any, fname: string) => string | undefined; baseUrl?: string; } declare function caml_plugin(md: MarkdownIt, opts?: Partial<CamlOptions>): void; export type { CamlOptions }; export { caml_plugin as default };