documentation icon indicating copy to clipboard operation
documentation copied to clipboard

can't generate proper clean docs

Open lfaz opened this issue 4 years ago • 7 comments

I am trying using the following command: documentation build ./packages/* -f html -o docs --shallow

It generates some docs that looks quite weird and it takes quite some time to generate doc. I would like to ignore all the dependencies and only generate doc from the main files. Wondering if the command I am running is right?

For some reason if I remove --shallow from the command it complains about not able to find x module hence I added --shallow

The folder project structure looks like below:

/packages
   /package1
     /node_modules
     /src
       index.js
       utils.js
     /package.json
   /package2
     /node_modules
     /src
       index.js
       utils.js
     package.json

I use version 13.1.0

Running thru CLI

Thank you,

lfaz avatar Jan 19 '21 19:01 lfaz

Could you try to be more specific than "quite weird"? For maintainers, this is really not a very good way to start an issue - there's absolutely no way that I could know what you mean by "weird".

It sounds like you have a pretty odd setup. I would recommend either:

  • Run documentation in each directory and point it at src.
  • Or use a glob that targets src in each directory. For example, ./packages/*/src/*

The command you're using tells the tool to document everything under packages, and your node_modules are installed under packages, so it's looking at all your node_modules.

tmcw avatar Jan 19 '21 19:01 tmcw

is there a way to exclude the node_modules?

lfaz avatar Jan 19 '21 19:01 lfaz

by weird I mean the docs generated shows some random stuff which I also dont know what they are exactly, probably coming from the libraries/dependecies used? Not sure!

lfaz avatar Jan 19 '21 19:01 lfaz

The glob that I recommended will exclude it.

tmcw avatar Jan 19 '21 19:01 tmcw

So do you mean I should run a command such as: documentation build ./packages/*/src/* -f html -o docs --shallow instead?

lfaz avatar Jan 19 '21 19:01 lfaz

I am getting error like:

SyntaxError: Unexpected token, expected ";" (2:14) at _temp._raise (/Users/lf/Desktop/work/xyz/node_modules/documentation/node_modules/@babel/parser/lib/index.js:799:17)

after running documentation build ./packages/*/src/* -f html -o docs --shallow

lfaz avatar Jan 19 '21 19:01 lfaz

@tmcw was wondering can we configure the include and exclude directories thru some config json file or smth similiar, currently having to use the glob patter the commands can become quite complex and not readable!

lfaz avatar Jan 20 '21 12:01 lfaz