wand/tools/lib.go

24 lines
590 B
Go
Raw Normal View History

2025-09-01 02:07:48 +02:00
package tools
import (
"code.squareroundforest.org/arpio/docreflect/generate"
"io"
"fmt"
)
type MarkdownOptions struct {
Level int
}
func Docreflect(out io.Writer, packageName string, gopaths ...string) error {
return generate.GenerateRegistry(out, packageName, gopaths...)
}
func Man(out io.Writer, commandDir string) error {
return execCommandDir(out, commandDir, "_wandgenerate=man")
}
func Markdown(out io.Writer, o MarkdownOptions, commandDir string) error {
return execCommandDir(out, commandDir, "_wandgenerate=markdown", fmt.Sprintf("_wandmarkdownlevel=%d", o.Level))
}