No description
  • Go 85.5%
  • Roff 7%
  • Dockerfile 5.2%
  • HCL 2.3%
Find a file
Sebastiaan van Stijn f18c6a7783
Merge pull request #78 from thaJeztah/bump_go
ci: update to go1.25, golangci-lint v2.9.0
2026-02-15 00:35:52 +01:00
.github ci: update to go1.25 2026-02-12 19:02:20 +01:00
annotation update golangci-lint to v2.1.5 2025-05-19 15:28:25 +02:00
example example: update dependencies 2025-12-09 14:52:13 +01:00
fixtures yaml: add "generated file" header 2026-02-11 11:50:42 +01:00
.dockerignore Rename package and move LoadLongDescription func 2021-08-03 22:46:09 +02:00
.gitignore Rename package and move LoadLongDescription func 2021-08-03 22:46:09 +02:00
.golangci.yml update golangci-lint to v2.1.5 2025-05-19 15:28:25 +02:00
clidocstool.go modernize some code 2026-02-12 18:58:15 +01:00
clidocstool_man.go man: prevent cobra "source" comment 2026-02-11 11:50:50 +01:00
clidocstool_man_test.go fix linting issues (revive) 2025-01-10 21:07:33 +01:00
clidocstool_md.go modernize some code 2026-02-12 18:58:15 +01:00
clidocstool_md_test.go fix linting issues (revive) 2025-01-10 21:07:33 +01:00
clidocstool_test.go skip hidden command recursively 2025-05-19 14:15:54 +02:00
clidocstool_yaml.go yaml: add "generated file" header 2026-02-11 11:50:42 +01:00
clidocstool_yaml_test.go fix linting issues (revive) 2025-01-10 21:07:33 +01:00
docker-bake.hcl ci: update bake-action to v6 2025-01-10 10:47:41 +01:00
Dockerfile update golangci-lint to v2.9.0 2026-02-12 19:04:49 +01:00
go.mod go.mod: update github.com/cpuguy83/go-md2man/v2 to v2.0.7 2025-12-09 14:38:14 +01:00
go.sum go.mod: update github.com/cpuguy83/go-md2man/v2 to v2.0.7 2025-12-09 14:38:14 +01:00
LICENSE Add license headers 2021-08-10 00:06:38 +02:00
markdown.go modernize some code 2026-02-12 18:58:15 +01:00
markdown_test.go modernize some code 2026-02-12 18:58:15 +01:00
README.md readme: fix badge 2022-12-26 06:31:34 +01:00

PkgGoDev Test Status Go Report Card

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