Generate static Go documentation
Go to file
Trevor Slocum 7f01197aa2 Remove code.rocketnine.space migration notice 2021-03-28 12:54:13 -07:00
.gitignore Initial commit 2020-02-06 08:37:24 -08:00
CHANGELOG Remove code.rocketnine.space migration notice 2021-03-28 12:54:13 -07:00
LICENSE Initial commit 2020-02-06 08:37:24 -08:00
README.md Remove code.rocketnine.space migration notice 2021-03-28 12:54:13 -07:00
badge.svg Initial commit 2020-02-06 08:37:24 -08:00
cmd.go Add --exclude flag and fix compilation on Windows 2020-02-07 07:38:30 -08:00
cmd_linux.go Add --exclude flag and fix compilation on Windows 2020-02-07 07:38:30 -08:00
go.mod Add code.rocketnine.space migration notice 2021-03-28 12:52:22 -07:00
go.sum Improve Go module support 2020-09-10 15:44:49 -07:00
main.go Improve Go module support 2020-09-10 15:44:49 -07:00
page.go Add code.rocketnine.space migration notice 2021-03-28 12:52:22 -07:00

README.md

godoc-static

CI status Donate

Generate static Go documentation

Demo

Rocket Nine Labs Documentation

Installation

Install godoc-static:

go get code.rocketnine.space/tslocum/godoc-static

Also install godoc:

go get golang.org/x/tools/cmd/godoc

Documentation

To generate documentation for specific packages, execute godoc-static supplying at least one package import path and/or absolute path:

godoc-static -destination=/home/user/sites/docs fmt net/http ~/awesomeproject

When an import path is supplied, the package is sourced from $GOPATH or $GOROOT.

When no packages are supplied, documentation is generated for packages listed by go list ....

Packages are not downloaded/updated automatically.

Usage examples

Generate documentation for archive, net/http and ~/go/src/code.rocketnine.space/tslocum/cview:

godoc-static \
    -site-name="Rocket Nine Labs Documentation" \
    -site-description-file=/home/user/sitefiles/description.md \
    -destination=/home/user/sites/docs \
    archive net/http code.rocketnine.space/tslocum/cview

Options

-destination

Path to write site to.

-exclude

Space-separated list of packages to exclude from the index.

Link to index.html instead of folder.

-listen-address

Address for godoc to listen on while scraping pages.

-site-description

Site description (markdown-enabled).

-site-description-file

Path to markdown file containing site description.

Site footer (markdown-enabled).

Path to markdown file containing site footer.

-site-name

Site name.

-verbose

Enable verbose logging.

-zip

Site ZIP file name.

Support

Please share issues and suggestions here.