Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better markdown docs generation #1721

Closed
tarampampam opened this issue Apr 13, 2023 · 2 comments · Fixed by #1722
Closed

Better markdown docs generation #1721

tarampampam opened this issue Apr 13, 2023 · 2 comments · Fixed by #1722
Labels
area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this

Comments

@tarampampam
Copy link
Contributor

Hi there, and thanks for your project! He is really awesome!

I could ask what you think about the improvement of markdown CLI docs generation - very often I use the following, hm... "addon" (which was crafted by me) to automatically update the CLI usage section in the project readme file: gh.tarampamp.am/urfave-cli-docs. In a few words, it allows using go generate ./... to update a section in the readme file (between the tags):

<!--GENERATED:CLI_DOCS-->
<!--/GENERATED:CLI_DOCS-->

With something like that:

image

From the sources:

import (
	"fmt"

	"github.com/urfave/cli/v2"
)

func NewApp() *cli.App {
	return &cli.App{
		Name:  "example",
		Usage: "Example CLI application",
		Commands: []*cli.Command{
			{
				Name:    "hello",
				Aliases: []string{"hi"},
				Usage:   "Prints hello",
				Action: func(c *cli.Context) error {
					fmt.Printf("Hello, %s!", c.String("name"))
					return nil
				},
				Flags: []cli.Flag{
					&cli.StringFlag{
						Name:    "name",
						Value:   "stranger",
						Usage:   "Just a name",
						Aliases: []string{"n"},
						EnvVars: []string{"NAME"},
					},
				},
			},
		},
	}
}

And I found this very useful, and probably other users of this library will find this useful and for them. Should I make PR with appropriate changes to this project, or not?

@tarampampam tarampampam added area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this labels Apr 13, 2023
@dearchap
Copy link
Contributor

@tarampampam Please submit a PR . Thank you so much

@tarampampam
Copy link
Contributor Author

@dearchap @urfave Could anyone review the changes in #1722?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants