File tree 1 file changed +38
-2
lines changed 1 file changed +38
-2
lines changed Original file line number Diff line number Diff line change 4
4
[ ![ Go Reference] ( https://pkg.go.dev/badge/github.com/urfave/cli-docs/v3.svg )] ( https://pkg.go.dev/github.com/urfave/cli-docs/v3 )
5
5
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/urfave/cli-docs/v3 )] ( https://goreportcard.com/report/github.com/urfave/cli-docs/v3 )
6
6
7
- urfave/cli-docs/v3 is an extended documentation library for use
8
- with urfave/cli/v3.
7
+ urfave/cli-docs/v3 is an extended documentation library for use with urfave/cli/v3.
8
+
9
+ ## Start using
10
+
11
+ 1 . Add the dependency to your project
12
+
13
+ ``` sh
14
+ go get github.com/urfave/cli-docs/v3@latest
15
+ ```
16
+
17
+ 2 . Add it as import
18
+
19
+ ``` diff
20
+ import (
21
+ + docs "github.com/urfave/cli-docs/v3"
22
+ )
23
+ ```
24
+
25
+ 3 . Now use it e.g. to generate markdown docu from a command
26
+
27
+ ``` go
28
+ func main () {
29
+ app := newApp ()
30
+ md , err := docs.ToMarkdown (app)
31
+ if err != nil {
32
+ panic (err)
33
+ }
34
+
35
+ fi , err := os.Create (" cli-docs.md" )
36
+ if err != nil {
37
+ panic (err)
38
+ }
39
+ defer fi.Close ()
40
+ if _ , err := fi.WriteString (" # CLI\n\n " + md); err != nil {
41
+ panic (err)
42
+ }
43
+ }
44
+ ```
You can’t perform that action at this time.
0 commit comments