MCPcopy Index your code
hub / github.com/coder/coder / main

Function main

scripts/apidocgen/postprocess/main.go:64–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62)
63
64func 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
94func loadMarkdownSections() ([][]byte, error) {
95 log.Printf("Read the md-file-single: %s", inMdFileSingle)

Callers

nothing calls this directly

Calls 5

loadMarkdownSectionsFunction · 0.85
prepareDocsDirectoryFunction · 0.85
writeDocsFunction · 0.85
FatalMethod · 0.80
ParseMethod · 0.65

Tested by

no test coverage detected