This repository has been archived on 2021-05-09. You can view files and clone it, but cannot push or open issues or pull requests.
gpm/docs.go
John Olheiser ef0d29afa3 Rewrite (#7)
Closes #6

This is, more or less, a fundamental rewrite of gpm.

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: #7
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-committed-by: John Olheiser <john.olheiser@gmail.com>
2021-02-28 13:04:05 +08:00

34 lines
439 B
Go

//+build docs
package main
import (
"os"
"strings"
"go.jolheiser.com/gpm/cmd"
)
func main() {
app := cmd.New()
md, err := app.ToMarkdown()
if err != nil {
panic(err)
}
// FIXME Why is this not fixed yet??
md = md[strings.Index(md, "#"):]
fi, err := os.Create("DOCS.md")
if err != nil {
panic(err)
}
if _, err := fi.WriteString(md); err != nil {
panic(err)
}
if err := fi.Close(); err != nil {
panic(err)
}
}