How can I generate HTML documents using `godoc`?

后端 未结 4 517
一生所求
一生所求 2021-01-31 01:53

I have written a small go program, and I want to generate standalone HTML documents from source code that can be viewed without godoc server. But I can\'t find any way to achiev

4条回答
  •  长发绾君心
    2021-01-31 02:27

    (Moved from https://stackoverflow.com/a/63905155/3715832)

    If you would like to try a different docs style, you can try Golds, which is an alternate Go docs generation tool (and a local docs server / code reader).

    Under your project directory, you can run any of the following commands to generate HTML docs for your Go project:

    • golds -gen -nouses -plainsrc -wdpkgs-listing=promoted ./...
    • golds -gen -nouses -wdpkgs-listing=promoted ./...
    • golds -gen -wdpkgs-listing=promoted ./...

    The first command generates the most compact docs and the last one generates the full docs, which size is 6 times of the compact docs.

    BTW, I'm the author of Golds. Hope you this tool would satisfy your need.

提交回复
热议问题