diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a9c4c19..659f12f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contribute to the docgen project +# Contribute to the cli-docs-tool project This page contains information about reporting issues as well as some tips and guidelines useful to experienced open source contributors. @@ -23,7 +23,7 @@ A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate a well-written, thorough bug report, and will thank you for it! -Check that [our issue database](https://github.com/docker/docgen/issues) +Check that [our issue database](https://github.com/docker/cli-docs-tool/issues) doesn't already include that problem or suggestion before submitting an issue. If you find a match, you can use the "subscribe" button to get notified on updates. Do *not* leave random "+1" or "I have this too" comments, as they diff --git a/README.md b/README.md index 9899791..6c4a8eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![PkgGoDev](https://img.shields.io/badge/go.dev-docs-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/docker/docgen) -[![Test Status](https://img.shields.io/github/workflow/status/crazy-max/docgen/build?label=test&logo=github&style=flat-square)](https://github.com/docker/docgen/actions?query=workflow%3Atest) -[![Go Report Card](https://goreportcard.com/badge/github.com/docker/docgen)](https://goreportcard.com/report/github.com/docker/docgen) +[![PkgGoDev](https://img.shields.io/badge/go.dev-docs-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/docker/cli-docs-tool) +[![Test Status](https://img.shields.io/github/workflow/status/docker/cli-docs-tool/build?label=test&logo=github&style=flat-square)](https://github.com/docker/cli-docs-tool/actions?query=workflow%3Atest) +[![Go Report Card](https://goreportcard.com/badge/github.com/docker/cli-docs-tool)](https://goreportcard.com/report/github.com/docker/cli-docs-tool) ## About @@ -26,7 +26,7 @@ We will use the example of `docker/buildx` and create a Go submodule in a $ mkdir docs $ cd ./docs $ go mod init github.com/docker/buildx/docs -$ go get github.com/docker/docgen +$ go get github.com/docker/cli-docs-tool ``` Your `go.mod` should look like this: @@ -37,7 +37,7 @@ module github.com/docker/buildx/docs go 1.16 require ( - github.com/docker/docgen v0.0.0 + github.com/docker/cli-docs-tool v0.0.0 ) ``` @@ -54,7 +54,7 @@ import ( "github.com/docker/buildx/commands" "github.com/docker/cli/cli/command" - "github.com/docker/docgen" + clidocstool "github.com/docker/cli-docs-tool" "github.com/spf13/cobra" ) @@ -75,7 +75,7 @@ func main() { } cmd.AddCommand(commands.NewRootCmd("buildx", true, dockerCLI)) - docgen.DisableFlagsInUseLine(cmd) + clidocstool.DisableFlagsInUseLine(cmd) cwd, _ := os.Getwd() source := filepath.Join(cwd, sourcePath) @@ -86,7 +86,7 @@ func main() { } // Generate Markdown and YAML documentation to "source" folder - if err = docgen.GenTree(cmd, source); err != nil { + if err = clidocstool.GenTree(cmd, source); err != nil { log.Printf("ERROR: %+v", err) } } @@ -95,7 +95,7 @@ func main() { Here we create a new instance of Docker CLI with `command.NewDockerCli` and a subcommand `commands.NewRootCmd` for `buildx`. -Finally, we generate Markdown and YAML documentation with `docgen.GenTree`. +Finally, we generate Markdown and YAML documentation with `clidocstool.GenTree`. ```console $ go run main.go diff --git a/docgen.go b/clidocstool.go similarity index 58% rename from docgen.go rename to clidocstool.go index 287abdd..b353f59 100644 --- a/docgen.go +++ b/clidocstool.go @@ -1,4 +1,4 @@ -// Copyright 2017 docgen authors +// Copyright 2017 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,52 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Doc generator specially crafted for Docker CLI plugins. -// -// Get started (buildx CLI): -// package main -// -// import ( -// "log" -// "os" -// "path/filepath" -// -// "github.com/docker/buildx/commands" -// "github.com/docker/cli/cli/command" -// "github.com/docker/docgen" -// "github.com/spf13/cobra" -// ) -// -// const sourcePath = "docs/reference/" -// -// func main() { -// log.SetFlags(0) -// -// dockerCLI, err := command.NewDockerCli() -// if err != nil { -// log.Printf("ERROR: %+v", err) -// } -// -// cmd := &cobra.Command{ -// Use: "docker [OPTIONS] COMMAND [ARG...]", -// Short: "The base command for the Docker CLI.", -// DisableAutoGenTag: true, -// } -// -// cmd.AddCommand(commands.NewRootCmd("buildx", true, dockerCLI)) -// docgen.DisableFlagsInUseLine(cmd) -// -// cwd, _ := os.Getwd() -// source := filepath.Join(cwd, sourcePath) -// -// if err = os.MkdirAll(source, 0755); err != nil { -// log.Printf("ERROR: %+v", err) -// } -// if err = docgen.GenTree(cmd, source); err != nil { -// log.Printf("ERROR: %+v", err) -// } -// } -package docgen +package clidocstool import ( "github.com/spf13/cobra" diff --git a/docgen_md.go b/clidocstool_md.go similarity index 98% rename from docgen_md.go rename to clidocstool_md.go index dd38ff6..a84be95 100644 --- a/docgen_md.go +++ b/clidocstool_md.go @@ -1,4 +1,4 @@ -// Copyright 2021 docgen authors +// Copyright 2021 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package docgen +package clidocstool import ( "bytes" diff --git a/docgen_md_test.go b/clidocstool_md_test.go similarity index 95% rename from docgen_md_test.go rename to clidocstool_md_test.go index 42a56c9..343e216 100644 --- a/docgen_md_test.go +++ b/clidocstool_md_test.go @@ -1,4 +1,4 @@ -// Copyright 2021 docgen authors +// Copyright 2021 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package docgen +package clidocstool import ( "io/ioutil" diff --git a/docgen_yaml.go b/clidocstool_yaml.go similarity index 99% rename from docgen_yaml.go rename to clidocstool_yaml.go index 608c1f1..bd46f81 100644 --- a/docgen_yaml.go +++ b/clidocstool_yaml.go @@ -1,4 +1,4 @@ -// Copyright 2017 docgen authors +// Copyright 2017 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package docgen +package clidocstool import ( "fmt" diff --git a/docgen_yaml_test.go b/clidocstool_yaml_test.go similarity index 95% rename from docgen_yaml_test.go rename to clidocstool_yaml_test.go index e611bff..53b7a71 100644 --- a/docgen_yaml_test.go +++ b/clidocstool_yaml_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 docgen authors +// Copyright 2017 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package docgen +package clidocstool import ( "io/ioutil" diff --git a/docker-bake.hcl b/docker-bake.hcl index 019b0c7..7fe8bc2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,4 +1,4 @@ -// Copyright 2021 docgen authors +// Copyright 2021 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/example/README.md b/example/README.md index f4d8ad4..789df02 100644 --- a/example/README.md +++ b/example/README.md @@ -4,8 +4,8 @@ The following example will generate YAML and Markdown docs for [Docker buildx](https://github.com/docker/buildx) CLI. ```console -git clone https://github.com/docker/docgen -cd docgen/example/ +git clone https://github.com/docker/cli-docs-tool +cd cli-docs-tool/example/ go mod download go run main.go ``` diff --git a/example/go.mod b/example/go.mod index 842dd53..c2c9fee 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,16 +1,16 @@ -module github.com/docker/docgen/example +module github.com/docker/cli-docs-tool/example go 1.16 require ( github.com/docker/buildx v0.6.0 github.com/docker/cli v20.10.7+incompatible - github.com/docker/docgen v0.0.0 + github.com/docker/cli-docs-tool v0.0.0 github.com/spf13/cobra v1.2.1 ) replace ( github.com/docker/cli => github.com/docker/cli v20.10.3-0.20210702143511-f782d1355eff+incompatible github.com/docker/docker => github.com/docker/docker v20.10.3-0.20210609100121-ef4d47340142+incompatible - github.com/docker/docgen => ../ + github.com/docker/cli-docs-tool => ../ ) diff --git a/example/main.go b/example/main.go index 675b90e..deefd8f 100644 --- a/example/main.go +++ b/example/main.go @@ -1,4 +1,4 @@ -// Copyright 2021 docgen authors +// Copyright 2021 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import ( "path/filepath" "github.com/docker/buildx/commands" + clidocstool "github.com/docker/cli-docs-tool" "github.com/docker/cli/cli/command" - "github.com/docker/docgen" "github.com/spf13/cobra" ) @@ -42,7 +42,7 @@ func main() { } cmd.AddCommand(commands.NewRootCmd("buildx", true, dockerCLI)) - docgen.DisableFlagsInUseLine(cmd) + clidocstool.DisableFlagsInUseLine(cmd) cwd, _ := os.Getwd() source := filepath.Join(cwd, sourcePath) @@ -50,7 +50,7 @@ func main() { if err = os.MkdirAll(source, 0755); err != nil { log.Printf("ERROR: %+v", err) } - if err = docgen.GenTree(cmd, source); err != nil { + if err = clidocstool.GenTree(cmd, source); err != nil { log.Printf("ERROR: %+v", err) } } diff --git a/go.mod b/go.mod index f4286f6..509a193 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/docker/docgen +module github.com/docker/cli-docs-tool go 1.16 diff --git a/hack/godev.Dockerfile b/hack/godev.Dockerfile index 1c757b3..e4ce09e 100644 --- a/hack/godev.Dockerfile +++ b/hack/godev.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -# Copyright 2021 docgen authors +# Copyright 2021 cli-docs-tool authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/license.Dockerfile b/hack/license.Dockerfile index 40e4b69..06ffb45 100644 --- a/hack/license.Dockerfile +++ b/hack/license.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -# Copyright 2021 docgen authors +# Copyright 2021 cli-docs-tool authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG LICENSE_ARGS="-c docgen -l apache" +ARG LICENSE_ARGS="-c cli-docs-tool -l apache" ARG LICENSE_FILES=".*\(Dockerfile\|\.go\|\.hcl\|\.sh\)" FROM ghcr.io/google/addlicense:v1.0.0 AS addlicense diff --git a/hack/lint.Dockerfile b/hack/lint.Dockerfile index e8caaae..458c10c 100644 --- a/hack/lint.Dockerfile +++ b/hack/lint.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -# Copyright 2021 docgen authors +# Copyright 2021 cli-docs-tool authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/test.Dockerfile b/hack/test.Dockerfile index 17a15f5..6530c27 100644 --- a/hack/test.Dockerfile +++ b/hack/test.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -# Copyright 2021 docgen authors +# Copyright 2021 cli-docs-tool authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/vendor.Dockerfile b/hack/vendor.Dockerfile index 9374fab..db0cf85 100644 --- a/hack/vendor.Dockerfile +++ b/hack/vendor.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -# Copyright 2021 docgen authors +# Copyright 2021 cli-docs-tool authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/markdown.go b/markdown.go index 1df4099..3284923 100644 --- a/markdown.go +++ b/markdown.go @@ -1,4 +1,4 @@ -// Copyright 2017 docgen authors +// Copyright 2017 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package docgen +package clidocstool import ( "regexp" diff --git a/markdown_test.go b/markdown_test.go index 481d05c..e801b22 100644 --- a/markdown_test.go +++ b/markdown_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 docgen authors +// Copyright 2017 cli-docs-tool authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package docgen +package clidocstool import "testing"