mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
docs: API enterprise (#5625)
* docs: audit, deploymentconfig, files, parameters * Swagger comments in workspacebuilds.go * structs in workspacebuilds.go * workspaceagents: instance identity * workspaceagents.go in progress * workspaceagents.go in progress * Agents * workspacebuilds.go * /workspaces * templates.go, templateversions.go * templateversion.go in progress * cancel * templateversions * wip * Merge * x-apidocgen * NullTime hack not needed anymore * Fix: x-apidocgen * Members * Fixes * Fix * WIP * WIP * Users * Logout * User profile * Status suspend activate * User roles * User tokens * Keys * SSH key * All * Typo * Fix * Entitlements * Groups * SCIM * Fix * Fix * Clean templates * Sort API pages * Fix: HashedSecret * General is first
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
@ -132,6 +133,18 @@ func writeDocs(sections [][]byte) error {
|
||||
})
|
||||
}
|
||||
|
||||
// Sort API pages
|
||||
// The "General" section is expected to be always first.
|
||||
sort.Slice(mdFiles, func(i, j int) bool {
|
||||
if mdFiles[i].title == "General" {
|
||||
return true // "General" < ... - sorted
|
||||
}
|
||||
if mdFiles[j].title == "General" {
|
||||
return false // ... < "General" - not sorted
|
||||
}
|
||||
return sort.StringsAreSorted([]string{mdFiles[i].title, mdFiles[j].title})
|
||||
})
|
||||
|
||||
// Update manifest.json
|
||||
type route struct {
|
||||
Title string `json:"title,omitempty"`
|
||||
|
Reference in New Issue
Block a user