Move documentation sources to site/content (#1428)

This commit is contained in:
Unai Martinez-Corral 2023-06-20 22:15:36 +01:00 committed by GitHub
parent cbe4865373
commit dcb405a939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 33 additions and 28 deletions

View File

@ -4,7 +4,7 @@ Cobra is a library for creating powerful modern CLI applications.
Cobra is used in many Go projects such as [Kubernetes](https://kubernetes.io/), Cobra is used in many Go projects such as [Kubernetes](https://kubernetes.io/),
[Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to [Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to
name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra. name a few. [This list](site/content/projects_using_cobra.md) contains a more extensive list of projects using Cobra.
[![](https://img.shields.io/github/actions/workflow/status/spf13/cobra/test.yml?branch=main&longCache=true&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest) [![](https://img.shields.io/github/actions/workflow/status/spf13/cobra/test.yml?branch=main&longCache=true&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest)
[![Go Reference](https://pkg.go.dev/badge/github.com/spf13/cobra.svg)](https://pkg.go.dev/github.com/spf13/cobra) [![Go Reference](https://pkg.go.dev/badge/github.com/spf13/cobra.svg)](https://pkg.go.dev/github.com/spf13/cobra)
@ -105,8 +105,8 @@ go install github.com/spf13/cobra-cli@latest
For complete details on using the Cobra-CLI generator, please read [The Cobra Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md) For complete details on using the Cobra-CLI generator, please read [The Cobra Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md)
For complete details on using the Cobra library, please read the [The Cobra User Guide](user_guide.md). For complete details on using the Cobra library, please read the [The Cobra User Guide](site/content/user_guide.md).
# License # License
Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt) Cobra is released under the Apache 2.0 license. See [LICENSE.txt](LICENSE.txt)

View File

@ -1,4 +0,0 @@
## Generating Fish Completions For Your cobra.Command
Please refer to [Shell Completions](shell_completions.md) for details.

View File

@ -1,3 +0,0 @@
# Generating PowerShell Completions For Your Own cobra.Command
Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details.

View File

@ -416,7 +416,7 @@ completion firstcommand secondcommand
### Bash legacy dynamic completions ### Bash legacy dynamic completions
For backward compatibility, Cobra still supports its bash legacy dynamic completion solution. For backward compatibility, Cobra still supports its bash legacy dynamic completion solution.
Please refer to [Bash Completions](bash_completions.md) for details. Please refer to [Bash Completions](bash.md) for details.
### Bash completion V2 ### Bash completion V2
@ -425,7 +425,7 @@ Cobra provides two versions for bash completion. The original bash completion (
A new V2 bash completion version is also available. This version can be used by calling `GenBashCompletionV2()` or A new V2 bash completion version is also available. This version can be used by calling `GenBashCompletionV2()` or
`GenBashCompletionFileV2()`. The V2 version does **not** support the legacy dynamic completion `GenBashCompletionFileV2()`. The V2 version does **not** support the legacy dynamic completion
(see [Bash Completions](bash_completions.md)) but instead works only with the Go dynamic completion (see [Bash Completions](bash.md)) but instead works only with the Go dynamic completion
solution described in this document. solution described in this document.
Unless your program already uses the legacy dynamic completion solution, it is recommended that you use the bash Unless your program already uses the legacy dynamic completion solution, it is recommended that you use the bash
completion V2 solution which provides the following extra features: completion V2 solution which provides the following extra features:
@ -482,7 +482,7 @@ search show status
### Zsh completions standardization ### Zsh completions standardization
Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced. Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced.
Please refer to [Zsh Completions](zsh_completions.md) for details. Please refer to [Zsh Completions](zsh.md) for details.
## fish completions ## fish completions

View File

@ -1,6 +1,6 @@
# Generating Bash Completions For Your cobra.Command # Generating Bash Completions For Your cobra.Command
Please refer to [Shell Completions](shell_completions.md) for details. Please refer to [Shell Completions](_index.md) for details.
## Bash legacy dynamic completions ## Bash legacy dynamic completions

View File

@ -0,0 +1,4 @@
## Generating Fish Completions For Your cobra.Command
Please refer to [Shell Completions](_index.md) for details.

View File

@ -0,0 +1,3 @@
# Generating PowerShell Completions For Your Own cobra.Command
Please refer to [Shell Completions](_index.md#powershell-completions) for details.

View File

@ -1,6 +1,6 @@
## Generating Zsh Completion For Your cobra.Command ## Generating Zsh Completion For Your cobra.Command
Please refer to [Shell Completions](shell_completions.md) for details. Please refer to [Shell Completions](_index.md) for details.
## Zsh completions standardization ## Zsh completions standardization

View File

@ -1,9 +1,9 @@
# Documentation generation # Documentation generation
- [Man page docs](./man_docs.md) - [Man page docs](man.md)
- [Markdown docs](./md_docs.md) - [Markdown docs](md.md)
- [Rest docs](./rest_docs.md) - [Rest docs](rest.md)
- [Yaml docs](./yaml_docs.md) - [Yaml docs](yaml.md)
## Options ## Options
### `DisableAutoGenTag` ### `DisableAutoGenTag`

View File

@ -29,8 +29,8 @@ func main() {
## Using the Cobra Generator ## Using the Cobra Generator
Cobra-CLI is its own program that will create your application and add any Cobra-CLI is its own program that will create your application and add any commands you want.
commands you want. It's the easiest way to incorporate Cobra into your application. It's the easiest way to incorporate Cobra into your application.
For complete details on using the Cobra generator, please refer to [The Cobra-CLI Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md) For complete details on using the Cobra generator, please refer to [The Cobra-CLI Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md)
@ -715,12 +715,17 @@ Run 'kubectl help' for usage.
## Generating documentation for your command ## Generating documentation for your command
Cobra can generate documentation based on subcommands, flags, etc. Read more about it in the [docs generation documentation](doc/README.md). Cobra can generate documentation based on subcommands, flags, etc.
Read more about it in the [docs generation documentation](docgen/_index.md).
## Generating shell completions ## Generating shell completions
Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell.
If you add more information to your commands, these completions can be amazingly powerful and flexible.
Read more about it in [Shell Completions](completions/_index.md).
## Providing Active Help ## Providing Active Help
Cobra makes use of the shell-completion system to define a framework allowing you to provide Active Help to your users. Active Help are messages (hints, warnings, etc) printed as the program is being used. Read more about it in [Active Help](active_help.md). Cobra makes use of the shell-completion system to define a framework allowing you to provide Active Help to your users.
Active Help are messages (hints, warnings, etc) printed as the program is being used.
Read more about it in [Active Help](active_help.md).