Commit 5c2438c
authored
The get_pack_commands.go generator uses cobra/doc.GenMarkdownTreeCustom to produce markdown from the pack command tree. Some pack commands include ANSI color codes in their description strings (e.g.
\x1b[94m...\x1b[0m) to improve terminal --help readability. These codes were passing through the generator unmodified and appearing as noise in the rendered documentation.
Added a post-generation step that walks the output directory and strips SGR ANSI escape sequences (\x1b\[[0-9;]*m) from all generated .md files. This is the appropriate place to handle the conversion
— the generator is the boundary between terminal output and markdown, and stripping color codes there keeps the fix localized without affecting the upstream CLI's terminal experience.
Signed-off-by: Lorenzo Campanella <enzocampanella98@gmail.com>
1 parent e2aee84 commit 5c2438c
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
67 | 91 | | |
68 | 92 | | |
69 | 93 | | |
| |||
0 commit comments