Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ jobs:
run: |
chmod +x ./bin/linux_amd64/crossplane
./bin/linux_amd64/crossplane config set features.enableAlpha true
./bin/linux_amd64/crossplane generate-docs -o ./docs/content/master/cli/command-reference.md
./bin/linux_amd64/crossplane generate-docs -o ./docs/content/cli/master/command-reference.md

- name: Run Vale
uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
with:
version: "3.14.2"
files: ./docs/content/master/cli/command-reference.md
files: ./docs/content/cli/master/command-reference.md
vale_flags: "--config=./docs/utils/vale/.vale.ini"
fail_on_error: true
reporter: local
Expand All @@ -217,4 +217,4 @@ jobs:
- name: Show generated docs on failure
if: ${{ failure() }}
run: |
cat ./docs/content/master/cli/command-reference.md
cat ./docs/content/cli/master/command-reference.md
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ git clone https://github.com/crossplane/docs.git
cd docs

# Generate the docs.
crossplane generate-docs -o content/master/cli/command-reference.md
crossplane generate-docs -o content/cli/master/command-reference.md

# Build the docs and serve them locally for preview.
hugo serve
Expand Down
2 changes: 1 addition & 1 deletion cmd/crossplane/docs-templates/command-reference.md.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
weight: 50
weight: 100
title: Command Reference
description: "Command reference for the Crossplane CLI"
---
Expand Down
10 changes: 9 additions & 1 deletion cmd/crossplane/xpkg/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ import (
"context"
"fmt"
"io"
"maps"
"net/url"
"os"
"os/exec"
"path/filepath"
"slices"
"strings"

"github.com/alecthomas/kong"
Expand Down Expand Up @@ -69,7 +71,13 @@ type initCmd struct {

func (c *initCmd) Help() string {
b := strings.Builder{}
for name, url := range WellKnownTemplates() {

// Sort the map keys to ensure stable help output.
tmpls := WellKnownTemplates()
names := slices.Sorted(maps.Keys(tmpls))

for _, name := range names {
url := tmpls[name]
fmt.Fprintf(&b, "- `%s` ([%s](%s))\n", name, url, url)
}

Expand Down
Loading