Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ebf408

Browse files
committed
Sort API pages
1 parent 03d9e9a commit 1ebf408

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

docs/manifest.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,8 @@
326326
"icon_path": "./images/icons/api.svg",
327327
"children": [
328328
{
329-
"title": "Authentication",
330-
"path": "./api/authentication.md"
331-
},
332-
{
333-
"title": "General",
334-
"path": "./api/general.md"
335-
},
336-
{
337-
"title": "Enterprise",
338-
"path": "./api/enterprise.md"
329+
"title": "Agents",
330+
"path": "./api/agents.md"
339331
},
340332
{
341333
"title": "Applications",
@@ -345,49 +337,57 @@
345337
"title": "Audit",
346338
"path": "./api/audit.md"
347339
},
340+
{
341+
"title": "Authentication",
342+
"path": "./api/authentication.md"
343+
},
348344
{
349345
"title": "Authorization",
350346
"path": "./api/authorization.md"
351347
},
352348
{
353-
"title": "Files",
354-
"path": "./api/files.md"
349+
"title": "Builds",
350+
"path": "./api/builds.md"
355351
},
356352
{
357-
"title": "Organizations",
358-
"path": "./api/organizations.md"
353+
"title": "Enterprise",
354+
"path": "./api/enterprise.md"
359355
},
360356
{
361-
"title": "Templates",
362-
"path": "./api/templates.md"
357+
"title": "Files",
358+
"path": "./api/files.md"
359+
},
360+
{
361+
"title": "General",
362+
"path": "./api/general.md"
363363
},
364364
{
365365
"title": "Members",
366366
"path": "./api/members.md"
367367
},
368368
{
369-
"title": "Workspaces",
370-
"path": "./api/workspaces.md"
369+
"title": "Organizations",
370+
"path": "./api/organizations.md"
371371
},
372372
{
373373
"title": "Parameters",
374374
"path": "./api/parameters.md"
375375
},
376376
{
377-
"title": "Users",
378-
"path": "./api/users.md"
377+
"title": "Schemas",
378+
"path": "./api/schemas.md"
379379
},
380380
{
381-
"title": "Builds",
382-
"path": "./api/builds.md"
381+
"title": "Templates",
382+
"path": "./api/templates.md"
383383
},
384384
{
385-
"title": "Agents",
386-
"path": "./api/agents.md"
385+
"title": "Users",
386+
"path": "./api/users.md"
387387
},
388388
{
389-
"title": "Schemas",
390-
"path": "./api/schemas.md"
389+
"title": "Workspaces",
390+
"path": "./api/workspaces.md"
391391
}
392392
]
393393
}

scripts/apidocgen/postprocess/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"path"
1111
"regexp"
12+
"sort"
1213
"strings"
1314

1415
"golang.org/x/xerrors"
@@ -132,6 +133,11 @@ func writeDocs(sections [][]byte) error {
132133
})
133134
}
134135

136+
// Sort API pages
137+
sort.Slice(mdFiles, func(i, j int) bool {
138+
return sort.StringsAreSorted([]string{mdFiles[i].title, mdFiles[j].title})
139+
})
140+
135141
// Update manifest.json
136142
type route struct {
137143
Title string `json:"title,omitempty"`

0 commit comments

Comments
 (0)