UNPKG

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