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.
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.
replacements := []struct {
old, new string