35b238ee82
This might break compatibility with projects using this module that are still on go1.16, which is EOL, so probably ok to ignore: github.com/docker/buildx/store imports github.com/gofrs/flock tested by github.com/gofrs/flock.test imports gopkg.in/check.v1 loaded from gopkg.in/check.v1@v1.0.0-20200227125254-8fa46927fb4f, but go 1.16 would select v1.0.0-20201130134442-10cb98267c6c To upgrade to the versions selected by go 1.16: go mod tidy -go=1.16 && go mod tidy -go=1.17 If reproducibility with go 1.16 is not needed: go mod tidy -compat=1.17 For other options, see: https://golang.org/doc/modules/pruning Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
3 years ago | |
---|---|---|
.. | ||
annotation | 3 years ago | |
.dockerignore | 3 years ago | |
.gitignore | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
clidocstool.go | 3 years ago | |
clidocstool_md.go | 3 years ago | |
clidocstool_yaml.go | 3 years ago | |
docker-bake.hcl | 3 years ago | |
markdown.go | 3 years ago |
README.md
About
This is a library containing utilities to generate (reference) documentation
for the docker
CLI on docs.docker.com.
Disclaimer
This library is intended for use by Docker's CLIs, and is not intended to be a general-purpose utility. Various bits are hard-coded or make assumptions that are very specific to our use-case. Contributions are welcome, but we will not accept contributions to make this a general-purpose module.
Usage
To generate the documentation it's recommended to do so using a Go submodule in your repository.
We will use the example of docker/buildx
and create a Go submodule in a
docs
folder (recommended):
$ mkdir docs
$ cd ./docs
$ go mod init github.com/docker/buildx/docs
$ go get github.com/docker/cli-docs-tool
Your go.mod
should look like this:
module github.com/docker/buildx/docs
go 1.16
require (
github.com/docker/cli-docs-tool v0.0.0
)
Next, create a file named main.go
inside that directory containing the
following Go code from example/main.go
.
Running this example should produce the following output:
$ go run main.go
INFO: Generating Markdown for "docker buildx bake"
INFO: Generating Markdown for "docker buildx build"
INFO: Generating Markdown for "docker buildx create"
INFO: Generating Markdown for "docker buildx du"
...
INFO: Generating YAML for "docker buildx uninstall"
INFO: Generating YAML for "docker buildx use"
INFO: Generating YAML for "docker buildx version"
INFO: Generating YAML for "docker buildx"
Generated docs will be available in the ./docs
folder of the project.
Contributing
Want to contribute? Awesome! You can find information about contributing to this project in the CONTRIBUTING.md