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; }