1
0
mirror of https://github.com/docker/cli-docs-tool.git synced 2025-08-08 10:22:04 +03:00

Rename project

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-08-20 15:55:17 +02:00
parent f1ab11512f
commit 40b1fb6971
19 changed files with 42 additions and 87 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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.

View File

@@ -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
```

View File

@@ -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 => ../
)

View File

@@ -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)
}
}

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/docker/docgen
module github.com/docker/cli-docs-tool
go 1.16

View File

@@ -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.

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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"

View File

@@ -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"