fix: broken links to completions docs in CLI reference

This commit is contained in:
Pasha Sviderski
2025-08-28 20:15:54 +10:00
parent db60a81b2d
commit 5a1e61ccff
2 changed files with 12 additions and 1 deletions
+12
View File
@@ -91,6 +91,18 @@ func postProcessMarkdown(filename string) error {
// Escape <id> to avoid Docusaurus treating it as an HTML tag. // Escape <id> to avoid Docusaurus treating it as an HTML tag.
content = strings.ReplaceAll(content, "<id>", "\\<id>") content = strings.ReplaceAll(content, "<id>", "\\<id>")
// Remove broken links to completion docs.
if strings.Contains(content, "[uc completion") {
lines := strings.Split(content, "\n")
var filteredLines []string
for _, line := range lines {
if !strings.Contains(line, "[uc completion") {
filteredLines = append(filteredLines, line)
}
}
content = strings.Join(filteredLines, "\n")
}
// Adjust heading levels. Process from shortest to longest to avoid double replacements. // Adjust heading levels. Process from shortest to longest to avoid double replacements.
replacements := []struct { replacements := []struct {
old, new string old, new string
-1
View File
@@ -15,7 +15,6 @@ A CLI tool for managing Uncloud resources such as clusters, machines, and servic
* [uc build](uc_build.md) - Build services from a Compose file. * [uc build](uc_build.md) - Build services from a Compose file.
* [uc caddy](uc_caddy.md) - Manage Caddy reverse proxy service. * [uc caddy](uc_caddy.md) - Manage Caddy reverse proxy service.
* [uc completion](uc_completion.md) - Generate the autocompletion script for the specified shell
* [uc ctx](uc_ctx.md) - Switch between different cluster contexts. Contains subcommands to manage contexts. * [uc ctx](uc_ctx.md) - Switch between different cluster contexts. Contains subcommands to manage contexts.
* [uc deploy](uc_deploy.md) - Deploy services from a Compose file. * [uc deploy](uc_deploy.md) - Deploy services from a Compose file.
* [uc dns](uc_dns.md) - Manage cluster domain in Uncloud DNS. * [uc dns](uc_dns.md) - Manage cluster domain in Uncloud DNS.