@vivliostyle/vfm
Version:
Custom Markdown syntax specialized in book authoring.
30 lines (29 loc) • 952 B
TypeScript
import { Handler } from 'mdast-util-to-hast';
import { Plugin } from 'unified';
import { Node } from 'unist';
/**
* Process Markdown AST.
* @returns Transformer or undefined (less than remark 13).
*/
export declare const mdast: Plugin;
/**
* Handle inline math to Hypertext AST.
* @param h Hypertext AST formatter.
* @param node Node.
* @returns Hypertext AST.
*/
export declare const handlerInlineMath: Handler;
/**
* Handle display math to Hypertext AST.
* @param h Hypertext AST formatter.
* @param node Node.
* @returns Hypertext AST.
*/
export declare const handlerDisplayMath: Handler;
/**
* Process math related Hypertext AST.
* Set the `<script>` to load MathJax and `<body>` attribute that enable math typesetting.
*
* This function does the work even if it finds a `<math>` that it does not treat as a VFM. Therefore, call it only if the VFM option is `math: true`.
*/
export declare const hast: () => (tree: Node) => void;