Closed ghost closed 8 years ago
Hey @CarlosRen,
Cleaver typically runs as a standalone program (from the command-line), though there is nothing stopping you from using it's undocumented API!
Look at bin/cleaver
for inspiration:
var presentation = new Cleaver(contents, options, path.resolve(path.dirname(file)));
presentation.run()
.then(function (product) {
var outputFile = presentation.options.output || path.basename(file, '.md') + '-cleaver.html';
fs.writeFile(outputFile, product);
})
.fail(function (err) {
process.stderr.write('!! ' + err.message + '\n');
if (program.debug) {
process.stderr.write(err.stack);
}
process.exit(1);
});
Does that sort of make sense? I'd love to help you get something working.
how can i use the cleaver in Express as module?