UNPKG

apeman-doc

Version:
34 lines (24 loc) 715 B
'use strict' const findout = require('findout') const apemanfile = require('apemanfile') const coz = require('coz') let apemanfileDocBud = require('./bud/apemanfile_doc_bud') /** @lends apemanDoc */ function apemanDoc (options = {}) { let dest = options.out || 'doc/apdoc.md' let asis = !!options.asis let $ctx = options.$ctx || options.ctx if ($ctx && typeof $ctx === 'string') { $ctx = findout($ctx) } let configuration = apemanfile(options.configuration, { $preloadedCtx: $ctx, $preloadedProto: asis ? [] : null }) let bud = apemanfileDocBud(configuration) bud.path = dest || bud.path return coz.render(bud, { prefix: 'apeman-doc' }) } module.exports = apemanDoc