The best way that worked for me was to annotation my documentation with @public
@private
etc. and then passing the option --access: ['public', 'private']
to selectively include the pieces that I wanted.
As par the 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"]
You could write a script to programmatically generate the docs
documentation
.build('src/index.js', { access: ["public"] })
.then(documentation.formats.md)
.then(markdown => {
fs.writeFileSync('README.md'), markdown);
})
.catch(error => console.error(error));
EDITED:
Just to be clear, here is how to use the console command -
documentation build ./src/index.js --access private public protected -f html -o docs