下载一个docdash模板插件,复制里面的所有内容到自己的模板文件目录。通过改tmpl文件内容自定义模板样式,更改publish.js生成自己想要的api文档。
gulpfile.js:
gulp.task('doc', function () {
var envPathSeperator = os.platform() === 'win32' ? ';' : ':';
return new Promise(function (resolve, reject) {
child_process.exec('jsdoc --configure Tools/jsdoc/conf.json', {
env: {
PATH: process.env.PATH + envPathSeperator + 'node_modules/.bin'
},
encoding: 'utf8',
timeout: 0,
maxBuffer: 5000 * 1024 // 默认 200 * 1024
}, function (error, stdout, stderr) {
if (error) {
console.log(stderr);
return reject(error);
}
var stream = gulp.src('source/example/**').pipe(gulp.dest(app.prdPath + 'doc/example'));
return streamToPromise(stream).then(resolve);
});
});
});
“plugins“: [
“Tools/jsdoc/cesiumTags“
//“plugins/markdown“
],
浙公网安备 33010602011771号