mirror of
https://gitea.com/jolheiser/sip
synced 2024-11-26 07:33:48 +01:00
36 lines
440 B
Go
36 lines
440 B
Go
|
// +build docs
|
||
|
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"strings"
|
||
|
|
||
|
"gitea.com/jolheiser/sip/cmd"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
app := cmd.NewApp("docs")
|
||
|
|
||
|
fi, err := os.Create("docs.md")
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
md, err := app.ToMarkdown()
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
// Clean up the header
|
||
|
md = md[strings.Index(md, "#"):]
|
||
|
|
||
|
if _, err := fi.WriteString(md); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
if err := fi.Close(); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|