How to not add every library inside Flutter project with Dartdoc

757 Views Asked by At

When I launch the command dartdoc --auto-include-dependencies, how can I do to not create documentation for every single library in the project? I use Melos in my project.

2

There are 2 best solutions below

7
Jahn E. On

Take a closer look at the documentation of the dartdoc package on pub.dev. Here is the link.

If you want to exclude single libraries (specific .dart files) you can use the @nodoc notation, which will be recognized by the package. For excluding entire folders you can move them in the directory lib/src, then the libraries will not be documented, see this.

0
Abhi Tripathi On

As of dartdoc 0.35.0 you can define nodoc as option and pass array of path of dart files with wild card *.dart in dartdoc_options.yaml. This will treat those files marked as ///@nodoc. Basically saves us writing ///@nodoc in required files

Example:

    dartdoc:

      nodoc: [ 'lib/utils/*.dart','lib/views/**/*.dart','lib/constants/*.dart' ]

Download file from here