Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
708 B

const pandoc = require('node-pandoc');
// const args = '-t html5';
const args = '-S --base-header-level=1 --toc --toc-depth=6 -N --normalize -s --mathjax -t html5';
console.log("");
module.exports=
{
convertToHTML: function(markdownContents)
{
return new Promise(function(resolve, reject)
{
// Set your callback function
callback = function (err, result)
{
if (err)
{
reject(err);
}
resolve(result);
};
pandoc(markdownContents, args, callback);
});
},
}