2020-02-05 17:28:02 +00:00
|
|
|
# godoc-static
|
|
|
|
[![CI status](https://gitlab.com/tslocum/godoc-static/badges/master/pipeline.svg)](https://gitlab.com/tslocum/godoc-static/commits/master)
|
|
|
|
[![Donate](https://img.shields.io/liberapay/receives/rocketnine.space.svg?logo=liberapay)](https://liberapay.com/rocketnine.space)
|
|
|
|
|
|
|
|
Generate static Go documentation
|
|
|
|
|
|
|
|
## Demo
|
|
|
|
|
|
|
|
[Rocket Nine Labs Documentation](https://docs.rocketnine.space)
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Install `godoc-static`:
|
|
|
|
|
2020-02-07 15:38:30 +00:00
|
|
|
```bash
|
|
|
|
go get gitlab.com/tslocum/godoc-static
|
|
|
|
```
|
2020-02-05 17:28:02 +00:00
|
|
|
|
|
|
|
Also install `godoc`:
|
|
|
|
|
2020-02-07 15:38:30 +00:00
|
|
|
```bash
|
|
|
|
go get golang.org/x/tools/cmd/godoc
|
|
|
|
```
|
2020-02-05 17:28:02 +00:00
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
2020-02-26 12:39:35 +00:00
|
|
|
To generate documentation for specific packages, execute `godoc-static`
|
2020-09-10 22:44:49 +00:00
|
|
|
supplying at least one package import path and/or absolute path:
|
2020-02-10 16:07:32 +00:00
|
|
|
|
|
|
|
```bash
|
2020-09-10 22:44:49 +00:00
|
|
|
godoc-static -destination=/home/user/sites/docs fmt net/http ~/awesomeproject
|
2020-02-10 16:07:32 +00:00
|
|
|
```
|
|
|
|
|
2020-09-10 22:44:49 +00:00
|
|
|
When an import path is supplied, the package is sourced from `$GOPATH` or `$GOROOT`.
|
|
|
|
|
2020-02-26 12:39:35 +00:00
|
|
|
When no packages are supplied, documentation is generated for packages listed
|
2020-09-10 22:44:49 +00:00
|
|
|
by `go list ...`.
|
2020-02-10 16:07:32 +00:00
|
|
|
|
2020-02-26 12:39:35 +00:00
|
|
|
Packages are not downloaded/updated automatically.
|
|
|
|
|
|
|
|
### Usage examples
|
|
|
|
|
2020-09-10 22:44:49 +00:00
|
|
|
Generate documentation for `archive`, `net/http` and `~/go/src/gitlab.com/tslocum/cview`:
|
2020-02-26 12:39:35 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
godoc-static \
|
|
|
|
-site-name="Rocket Nine Labs Documentation" \
|
|
|
|
-site-description-file=/home/user/sitefiles/description.md \
|
|
|
|
-destination=/home/user/sites/docs \
|
|
|
|
archive net/http gitlab.com/tslocum/cview
|
|
|
|
```
|
2020-02-10 16:07:32 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -destination
|
|
|
|
Path to write site to.
|
|
|
|
|
|
|
|
#### -exclude
|
|
|
|
Space-separated list of packages to exclude from the index.
|
|
|
|
|
|
|
|
#### -link-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
|
|
|
|
Site footer (markdown-enabled).
|
|
|
|
|
|
|
|
#### -site-footer-file
|
|
|
|
Path to markdown file containing site footer.
|
|
|
|
|
|
|
|
#### -site-name
|
|
|
|
Site name.
|
|
|
|
|
|
|
|
#### -verbose
|
|
|
|
Enable verbose logging.
|
2020-02-05 17:28:02 +00:00
|
|
|
|
2020-02-26 14:10:28 +00:00
|
|
|
#### -zip
|
|
|
|
Site ZIP file name.
|
|
|
|
|
2020-02-05 17:28:02 +00:00
|
|
|
## Support
|
|
|
|
|
2020-02-26 14:10:28 +00:00
|
|
|
Please share issues and suggestions [here](https://gitlab.com/tslocum/godoc-static/issues).
|