forked from thetatoken/theta-protocol-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generator.go
40 lines (33 loc) · 885 Bytes
/
generator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"log"
"strings"
"github.com/spf13/cobra/doc"
theta "github.com/thetatoken/theta/cmd/theta/cmd"
thetacli "github.com/thetatoken/theta/cmd/thetacli/cmd"
)
func generateThetaCLIDoc(filePrepender, linkHandler func(string) string) {
var all = thetacli.RootCmd
err := doc.GenMarkdownTreeCustom(all, "./wallet/", filePrepender, linkHandler)
if err != nil {
log.Fatal(err)
}
}
func generateThetaDoc(filePrepender, linkHandler func(string) string) {
var all = theta.RootCmd
err := doc.GenMarkdownTreeCustom(all, "./ledger/", filePrepender, linkHandler)
if err != nil {
log.Fatal(err)
}
}
func main() {
filePrepender := func(filename string) string {
return ""
}
linkHandler := func(name string) string {
return strings.ToLower(name)
}
generateThetaCLIDoc(filePrepender, linkHandler)
generateThetaDoc(filePrepender, linkHandler)
Walk()
}