You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
7 months ago | |
---|---|---|
examples | 7 months ago | |
.gitignore | 7 months ago | |
LICENSE | 7 months ago | |
README.md | 7 months ago | |
ffmd.go | 7 months ago | |
ffmd.tmpl | 7 months ago | |
go.mod | 7 months ago | |
go.sum | 7 months ago | |
tree.go | 7 months ago | |
tree_test.go | 7 months ago |
README.md
ffmd
One of the things that I really liked about urfave/cli was that it could generate markdown docs for my commands.
With ffmd
you can generate markdown docs for both flag.FlagSet
and ffcli.Command
(with any amount of sub-commands).
Check out examples for some sample generated docs.
Generate your docs
//go:build generate
// +build generate
package main
import (
"os"
"go.jolheiser.com/ffmd"
)
func main() {
fi, err := os.Create("docs.md")
if err != nil {
panic(err)
}
defer fi.Close()
// cmd is the ffcli.Command
md, err := ffmd.Command(cmd)
if err != nil {
panic(err)
}
if _, err := fi.WriteString(md); err != nil {
panic(err)
}
}