1

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.

spydon
  • 9,372
  • 6
  • 33
  • 63

2 Answers2

1

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

Abhi Tripathi
  • 526
  • 2
  • 10
0

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.

Jahn E.
  • 1,228
  • 3
  • 6
  • 21
  • thanks for the answer. But, how I can do for don't create documentation about Flutter libraries? like bloc or bloc_test..? – Alessandro Antonio Del Gaudio Nov 25 '21 at 14:59
  • Why cant you add your bloc files unter src? So you have lib/src/bloc and e.g. lib/src/screens - for tests you could either add the notation, there might be better solutions though. I recommend diving deeper into the package docs – Jahn E. Nov 25 '21 at 15:15
  • no sir probably, I can't explain my situation: I have a Melos project and, when I launch the command 'dartdoc --auto-include-dependencies', It generates documentation for every single library (dart:js, dart:core, bloc etc). I want that this, doesn't appear but I don't know how..these libraries aren't mine, so I can't push it under lib/src – Alessandro Antonio Del Gaudio Nov 25 '21 at 15:21
  • Ah okay. However, I am not familiar with Melos at all sorry. – Jahn E. Nov 25 '21 at 15:29
  • maybe I have the solution. I can go inside every single folder and launch dartdoc. maybe it will be useful, what do you think ? – Alessandro Antonio Del Gaudio Nov 25 '21 at 15:32
  • Oh I see, yeah you should of course run it inside the lib folder, else you include everysingle dart library with your command (and there are a lot ;) ) - Let me know if that works and I will update the answer for future references! – Jahn E. Nov 25 '21 at 15:38
  • Well, it is too difficult to do that, because there are too many things to do..so maybe, it's better to create a dartdoc_options.yaml and maybe, you can do the same thing but in a easy way (I think) – Alessandro Antonio Del Gaudio Nov 25 '21 at 16:56