/** * remark plugin (unified transformer): replaces PlantUML `code` nodes of an * mdast tree by rendered diagrams. No dependency on unified or remark; only * the mdast node shape is used (`code` with `lang`/`meta`). * * - `mode: "inline"` (default): an `html` node with the sanitised SVG. Needs * `remark-rehype` with `allowDangerousHtml` plus `rehype-raw` (Astro already * does this; MDX does not support `html` nodes — use `mode: "file"` there). * - `mode: "file"`: a paragraph with an `image` node; the SVG is passed to * `writeFile(name, data)` (`name` = `/.svg`), the image URL * is `/.svg`. * @module markdown/remark */ export type RemarkExcaliplantOptions = import("./render.mjs").BlockOptions & { mode?: "inline" | "file"; assetsDir?: string; assetsUrl?: string; writeFile?: (name: string, data: string) => void | Promise; onError?: "box" | "keep" | "throw"; shareFont?: boolean; budget?: Partial; }; /** * remark attacher. Use as `unified().use(remarkExcaliplant, options)`. * @param {RemarkExcaliplantOptions} [options] * @returns {(tree: any, file?: any) => Promise} The transformer. * @public */ export default function remarkExcaliplant(options?: RemarkExcaliplantOptions): (tree: any, file?: any) => Promise;