golds icon indicating copy to clipboard operation
golds copied to clipboard

How to generate docs for project only?

Open indrasvat opened this issue 4 years ago • 8 comments

How to restrict golds to generate the HTML docs for just the current project?

$ ls -Altr
total 96
-rw-r--r--   1 user  wheel    22B Dec 30 15:17 .gitignore
-rw-r--r--   1 user  wheel   1.1K Dec 30 15:17 LICENSE
-rw-r--r--   1 user  wheel    10K Dec 30 15:17 README.md
-rw-r--r--   1 user  wheel    12K Dec 30 15:17 TODO.md
drwxr-xr-x   8 user  wheel   256B Dec 30 15:17 code/
-rw-r--r--   1 user  wheel   126B Dec 30 15:17 go.mod
-rw-r--r--   1 user  wheel   2.7K Dec 30 15:17 go.sum
drwxr-xr-x   3 user  wheel    96B Dec 30 15:17 gocore/
drwxr-xr-x   3 user  wheel    96B Dec 30 15:17 godoge/
drwxr-xr-x   3 user  wheel    96B Dec 30 15:17 gold/
drwxr-xr-x   6 user  wheel   192B Dec 30 15:17 internal/
-rw-r--r--   1 user  wheel    85B Dec 30 15:17 main.go
drwxr-xr-x  12 user  wheel   384B Dec 30 15:17 .git/


$ golds -emphasize-wdpkgs -compact -gen -dir=.generated .
...
golds-docs

indrasvat avatar Dec 30 '20 23:12 indrasvat

It is easy to only show docs of the current project only (without dependency package docs) in the starting page.

If you mean to avoid generating docs of the dependency packages totally, there are some difficulties to achieve this. I'm not sure if this is possible now. I will take this to heart until I find a solution.

zigo101 avatar Dec 31 '20 14:12 zigo101

Thanks, @go101! The latter is what I had in mind (to match what javadoc / jsdoc typically does). Not urgent, just thought of checking to see if it was possible / supported.

indrasvat avatar Dec 31 '20 18:12 indrasvat

It is easy to only show docs of the current project only (without dependency package docs) in the starting page.

How to do this? I'm totally Ok to generate the documentation for all dependencies, but I would like to see only the documentation of project only on main page

SVilgelm avatar Jan 13 '21 22:01 SVilgelm

A new option -wdpkgs-display=promoted|solo|general will be added in the next version. The old option -emphasize-wdpkgs will be replaced with -wdpkgs-display=promoted. And -wdpkgs-display=solo is used to show docs of packages in the current directory.

zigo101 avatar Jan 14 '21 02:01 zigo101

Thanks!

SVilgelm avatar Jan 14 '21 02:01 SVilgelm

A -wdpkgs-listing=promoted|solo|general option is added in v0.1.8.

zigo101 avatar Jan 17 '21 16:01 zigo101

Can the imported packages be removed if --wdpkgs-listing is set to solo? I have a very simple project whose documentation takes a couple kilobytes but golds generates an 80MB monstrosity which includes the entire standard library.

vultbot avatar Jul 13 '22 16:07 vultbot

@vultbot You can add --compact option to reduce the size. About more options, please read https://go101.org/apps-and-libs/golds.html

zigo101 avatar Jul 14 '22 01:07 zigo101