Utilities to generate (reference) documentation for the docker CLI
Перейти к файлу
dependabot[bot] 0729659e07
Bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 09:58:24 +00:00
.github Bump actions/setup-go from 3 to 4 2023-03-16 09:58:24 +00:00
annotation annotation to override default value 2022-02-17 13:45:16 +01:00
example example: update to buildx 0.8.2 2022-06-29 02:05:00 +02:00
fixtures markdown: format generated tables to have equal-width columns 2022-12-29 01:05:02 +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 dockerfile: upgrade golangci-lint to 1.45 2022-06-13 20:59:12 +02:00
Dockerfile dockerfile: upgrade golangci-lint to 1.45 2022-06-13 20:59:12 +02:00
LICENSE Add license headers 2021-08-10 00:06:38 +02:00
README.md readme: fix badge 2022-12-26 06:31:34 +01:00
clidocstool.go use custom annotation for aliases 2022-06-29 02:00:12 +02:00
clidocstool_md.go markdown: format generated tables to have equal-width columns 2022-12-29 01:05:02 +01:00
clidocstool_md_test.go replace uses of os/ioutil, and use test.TempDir() in tests 2022-02-23 20:42:04 +01:00
clidocstool_test.go markdown: replace new line in usage 2022-12-26 06:31:33 +01:00
clidocstool_yaml.go Bump gopkg.in/yaml.v2 to gopkg.in/yaml.v3 3.0.1 2022-06-29 02:04:59 +02:00
clidocstool_yaml_test.go replace uses of os/ioutil, and use test.TempDir() in tests 2022-02-23 20:42:04 +01:00
docker-bake.hcl dockerfile: merge dockerfiles 2022-06-13 20:52:21 +02:00
go.mod Bump github.com/spf13/cobra from 1.2.1 to 1.4.0 2022-06-29 02:05:00 +02:00
go.sum Bump github.com/spf13/cobra from 1.2.1 to 1.4.0 2022-06-29 02:05:00 +02:00
markdown.go Rename project 2021-08-20 15:55:23 +02:00
markdown_test.go Rename project 2021-08-20 15:55:23 +02:00

README.md

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