()
| 62 | ) |
| 63 | |
| 64 | func main() { |
| 65 | log.Println("Postprocess API docs") |
| 66 | |
| 67 | flag.StringVar(&docsDirectory, "docs-directory", "../../docs", "Path to Coder docs directory") |
| 68 | flag.StringVar(&inMdFileSingle, "in-md-file-single", "", "Path to single Markdown file, output from widdershins.js") |
| 69 | flag.Parse() |
| 70 | |
| 71 | if inMdFileSingle == "" { |
| 72 | flag.Usage() |
| 73 | log.Fatal("missing value for in-md-file-single") |
| 74 | } |
| 75 | |
| 76 | sections, err := loadMarkdownSections() |
| 77 | if err != nil { |
| 78 | log.Fatal("can't load markdown sections: ", err) |
| 79 | } |
| 80 | |
| 81 | err = prepareDocsDirectory() |
| 82 | if err != nil { |
| 83 | log.Fatal("can't prepare docs directory: ", err) |
| 84 | } |
| 85 | |
| 86 | err = writeDocs(sections) |
| 87 | if err != nil { |
| 88 | log.Fatal("can't write docs directory: ", err) |
| 89 | } |
| 90 | |
| 91 | log.Println("Done") |
| 92 | } |
| 93 | |
| 94 | func loadMarkdownSections() ([][]byte, error) { |
| 95 | log.Printf("Read the md-file-single: %s", inMdFileSingle) |
nothing calls this directly
no test coverage detected