gulp 如何使用 jsdoc?
How to use jsdoc with gulp?
如何创建 gulp 命令以使用 jsdoc 构建文档?
我不想使用 gulp-jsdoc package, as it is not maintained. And the package I had been using to call it from the command line, gulp-shell, is on the gulp blacklist。
像这样使用节点的内置 child_process:
var child_exec = require('child_process').exec;
gulp.task('docs', function(done) {
child_exec('node ./node_modules/jsdoc/jsdoc.js ./lib -c ./jsdoc.json', undefined, done);
});
(此示例假设您有一个配置文件 ./jsdoc.json
,但更改调用语法很容易。)
如何创建 gulp 命令以使用 jsdoc 构建文档?
我不想使用 gulp-jsdoc package, as it is not maintained. And the package I had been using to call it from the command line, gulp-shell, is on the gulp blacklist。
像这样使用节点的内置 child_process:
var child_exec = require('child_process').exec;
gulp.task('docs', function(done) {
child_exec('node ./node_modules/jsdoc/jsdoc.js ./lib -c ./jsdoc.json', undefined, done);
});
(此示例假设您有一个配置文件 ./jsdoc.json
,但更改调用语法很容易。)