apeman-doc
Version:
Document generator for apeman.
38 lines (30 loc) • 949 B
JavaScript
;
const argx = require('argx'),
assert = require('assert'),
async = require('async'),
stringcase = require('stringcase'),
apemanfile = require('apemanfile'),
coz = require('coz');
let apemanfileDocBud = require('./bud/apemanfile_doc_bud');
/** @lends apemanDoc */
function apemanDoc(options, callback) {
let args = argx(arguments);
callback = args.pop('function');
options = args.pop('object') || {};
let dest = options.out || 'doc/apdoc.md';
async.waterfall([
(callback) => {
apemanfile.load(options.configuration, {
asis: options.asis
}, callback);
},
(apemanfile, callback) => {
let bud = apemanfileDocBud(apemanfile);
bud.path = dest || bud.path;
coz.render(bud, {
prefix: 'apeman-doc'
}, callback);
}
], callback);
}
module.exports = apemanDoc;