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 achieve it. if anyone could help me, I'll appreciate it.
我编写了一个小型go程序，我想从源代码生成独立的HTML文档，而无需查看即可 godoc服务器。 但是我找不到任何方法来实现它。 如果有人可以帮助我，我将不胜感激。 p> div>
- 好问题 提建议
3条回答 默认 最新
- doutinghou6980 2012-11-23 13:42最佳回答
A simple HTML documentation can be produced by, for example:
$ godoc -html container/heap Interface > page.html
A bit better form can by produced by:
$ godoc -url "http://localhost:6060/pkg/container/heap/" > page.html
(I have godoc server running at :6060 and I'm not sure if that's a prerequisite).
The HTML would probably look better if combined with original CSS styles found in the Go repository by adjusting the produced HTML files to properly refer to it.评论解决 无用打赏举报分享