Skip to content

Commit 283012a

Browse files
authored
Remove backquote_terms function and its references
Removed the backquote_terms function and its usage in formatting options and descriptions.
1 parent 04f1d92 commit 283012a

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

dev/generate_cli_docs.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,6 @@ def escape_html_tags(text: str) -> str:
5757

5858
return "".join(result)
5959

60-
61-
def backquote_terms(text: str) -> str:
62-
"""
63-
Wrap code-style terms (ALL_CAPS, example module names, file paths, angle brackets, .Name) in backticks.
64-
"""
65-
# Backquote ALL_CAPS terms
66-
text = re.sub(r"\b([A-Z_]{2,})\b", r"`\1`", text)
67-
# Backquote example modules and paths (simple heuristics)
68-
text = re.sub(r"\b([a-zA-Z0-9_\.]+\.py)\b", r"`\1`", text)
69-
text = re.sub(r"\b([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\b", r"`\1`", text)
70-
# Backquote things like :SpecificFlowName, :AnythingName
71-
text = re.sub(r"(:[a-zA-Z0-9_]+Name\b)", r"`\1`", text)
72-
# Backquote things in angle brackets (e.g., <APP_TARGET>)
73-
text = re.sub(r"(<[A-Z_]+>)", r"`\1`", text)
74-
return text
75-
76-
7760
def format_options_section(help_text: str) -> str:
7861
"""Extract and format the options section."""
7962
lines = help_text.split("\n")
@@ -108,7 +91,6 @@ def format_options_section(help_text: str) -> str:
10891
# Save previous option if exists
10992
if current_option is not None:
11093
desc = " ".join(current_description).strip()
111-
desc = backquote_terms(desc)
11294
desc = escape_html_tags(desc) # Escape HTML tags for MDX compatibility
11395
formatted_options.append(f"| `{current_option}` | {desc} |")
11496

@@ -135,7 +117,6 @@ def format_options_section(help_text: str) -> str:
135117
# Add last option
136118
if current_option is not None:
137119
desc = " ".join(current_description).strip()
138-
desc = backquote_terms(desc)
139120
desc = escape_html_tags(desc) # Escape HTML tags for MDX compatibility
140121
formatted_options.append(f"| `{current_option}` | {desc} |")
141122

@@ -174,7 +155,6 @@ def format_commands_section(help_text: str) -> str:
174155
if match:
175156
command = match.group(1)
176157
description = match.group(2).strip()
177-
description = backquote_terms(description)
178158
# Truncate long descriptions
179159
if len(description) > 80:
180160
description = description[:77] + "..."
@@ -206,8 +186,7 @@ def extract_description(help_text: str) -> str:
206186

207187
# Collapse multiple blank lines into a single blank line
208188
description = "\n".join(description_lines) if description_lines else ""
209-
description = re.sub(r"\n{2,}", "\n", description)
210-
description = backquote_terms(description)
189+
description = re.sub(r"\n{3,}", "\n\n", description)
211190
return escape_html_tags(description) # Escape HTML tags for MDX compatibility
212191

213192

@@ -305,4 +284,4 @@ def main() -> None:
305284

306285

307286
if __name__ == "__main__":
308-
main()
287+
main()

0 commit comments

Comments
 (0)