UNPKG

567 BJavaScriptView Raw
1/* Dependencies. */
2const xtend = require('xtend')
3const one = require('./one')
4const preprocess = require('./pre-visitors')
5
6/* Expose. */
7module.exports = stringify
8
9/* Stringify the given MDAST node. */
10function toLaTeX (node, options, root) {
11 return one(options, node, undefined, undefined, root)
12}
13
14/* Compile MDAST tree using toLaTeX */
15function stringify (config) {
16 const settings = xtend(config, this.data('settings'))
17
18 this.Compiler = compiler
19
20 function compiler (tree) {
21 preprocess(settings, tree)
22 return toLaTeX(tree, settings, tree)
23 }
24}