MCPcopy Create free account
hub / github.com/pydio/cells / writeMultiPageMd

Function writeMultiPageMd

common/utils/docs/api-markdown.go:194–234  ·  view source on GitHub ↗
(folder string, data *TplData)

Source from the content-addressed store, hash-verified

192}
193
194func writeMultiPageMd(folder string, data *TplData) error {
195 // if e := toMd(folder, ApiDocsOutputRootTitle, ApiDocsOutputRootId, multiMain, map[string]string{
196 // "GeneratedBy": ApiDocsGeneratedBy,
197 // "GeneratedOn": ApiDocsGeneratedOn,
198 // }); e != nil {
199 // return e
200 // }
201 srvF := filepath.Join(folder, ApiDocsOutputRootId)
202 for _, s := range data.Services {
203 s.GeneratedBy = ApiDocsGeneratedBy
204 s.GeneratedOn = ApiDocsGeneratedOn
205 // write index.md
206 // if e := toMd(srvF, s.Title, "index", multiService, s); e != nil {
207 // return e
208 // }
209
210 // write .nav.yaml
211 // if e := writeNavYaml(srvF, &TplNav{Title: s.Title, Weight: 2}); e != nil {
212 // return e
213 // }
214
215 opF := filepath.Join(srvF, s.Name)
216 for _, o := range s.Operations {
217 id := o.Type + "-" + strings.Replace(o.Path, "/", "_", -1)
218 o.GeneratedBy = ApiDocsGeneratedBy
219 o.GeneratedOn = ApiDocsGeneratedOn
220 if e := toMd(opF, o.Type+" "+o.Path, id, multiOperation, o); e != nil {
221 return e
222 }
223 // write .nav.yaml
224 if e := writeNavYaml(opF, &TplNav{Title: s.Title, Weight: 1}); e != nil {
225 return e
226 }
227 // write index.md
228 if e := toMd(opF, s.Title, "index", multiOperation, o); e != nil {
229 return e
230 }
231 }
232 }
233 return nil
234}
235
236func writeNavYaml(folder string, data interface{}) error {
237 os.MkdirAll(folder, 0777)

Callers 1

GenOpenAPIDocsFunction · 0.85

Calls 4

toMdFunction · 0.85
writeNavYamlFunction · 0.85
JoinMethod · 0.45
ReplaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…