How can I generate HTML documents using `godoc`?

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.


This might not directly answer your question, but if you are planning to open source your project, you don't really have to generate HTML manually. Just make sure you have comments properly inserted in your source code, and use godoc.org( http://godoc.org/-/about ) to handle it.

It displays documentation for Go packages on Bitbucket, Github, Launchpad and Google Project Hosting.

Check this out for example: http://godoc.org/code.google.com/p/go.crypto/ssh