特别是,我对排除任何node_modules文件夹感兴趣,但还有其他文件夹需要排除。
这通常是在配置文件中完成的;例如,.jsdoc文件,如下所示:
"source": {
"include" : ["../projects"],
"includePattern": ".*src\\\\.+\\.js(doc|x)?$",
"excludePattern": "(node_modules|docs)"
}发布于 2018-12-01 06:29:03
对我来说,最好的方法是用@public、@private等注释我的文档,然后传递选项--access: ['public', 'private'],以便有选择地包含我想要的部分。
As par documentation
--access, -a Include only comments with a given access level,
out of private, protected, public, undefined. By
default, public, protected, and undefined access
levels are included
[array] [choices: "public", "private", "protected", "undefined"]您可以编写一个脚本来以编程方式生成文档
documentation
.build('src/index.js', { access: ["public"] })
.then(documentation.formats.md)
.then(markdown => {
fs.writeFileSync('README.md'), markdown);
})
.catch(error => console.error(error));编辑:
为了清楚起见,下面是如何使用控制台命令-
documentation build ./src/index.js --access private public protected -f html -o docshttps://stackoverflow.com/questions/48649110
复制相似问题