OTM/compile_pandoc.js

21 lines
535 B
JavaScript
Raw Normal View History

2021-07-16 09:12:30 +02:00
const pandoc = require('node-pandoc');
const path = require('path');
module.exports = (KEY)=>{
this.key = KEY;
this.compile_cv = (src,style)=>{
return new Promise((resolve,reject)=>{
style = "default-otm";
let args = `-s --section-divs --template template/${style}.html -f markdown+raw_html+header_attributes+definition_lists+yaml_metadata_block -t html5`;
/* --variable=date:'$(DATE)' \ */
pandoc(src, args, (err, res)=>{
if (err) reject(err);
return resolve(res);
});
})
}
return this;
}