docs: order configuration template fileds alphabetically (#12771)

pull/12788/head
Trevor Whitney 1 year ago committed by GitHub
parent 6ebfbe658b
commit 4404f7d2f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7186
      docs/sources/shared/configuration.md
  2. 13
      tools/doc-generator/main.go
  3. 14
      tools/doc-generator/parse/root_blocks.go

File diff suppressed because it is too large Load Diff

@ -15,6 +15,7 @@ import (
"github.com/grafana/loki/v3/pkg/loki"
"github.com/grafana/loki/v3/tools/doc-generator/parse"
"golang.org/x/exp/slices"
)
const (
@ -94,6 +95,18 @@ func annotateFlagPrefix(blocks []*parse.ConfigBlock) {
}
func generateBlocksMarkdown(blocks []*parse.ConfigBlock) string {
slices.SortFunc(blocks, func(a, b *parse.ConfigBlock) int {
if a.Name < b.Name {
return -1
}
if a.Name > b.Name {
return 1
}
return 0
})
md := &markdownWriter{}
md.writeConfigDoc(blocks)
return md.string()

@ -12,6 +12,7 @@ import (
"github.com/grafana/dskit/kv/memberlist"
"github.com/grafana/dskit/runtimeconfig"
"github.com/grafana/dskit/server"
"golang.org/x/exp/slices"
"github.com/grafana/loki/v3/pkg/analytics"
"github.com/grafana/loki/v3/pkg/bloomcompactor"
@ -288,3 +289,16 @@ Named store from this example can be used by setting object_store to store-1 in
},
}
)
func init() {
slices.SortFunc(RootBlocks, func(a, b RootBlock) int {
if a.Name < b.Name {
return -1
}
if a.Name > b.Name {
return 1
}
return 0
})
}

Loading…
Cancel
Save