Skip to content

Commit 5c61b2a

Browse files
authored
Configure sphinx-copybutton to strip prompts (#11702)
1 parent 20d270d commit 5c61b2a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/html/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,9 @@ def to_document_name(path: str, base_dir: str) -> str:
131131

132132

133133
man_pages = determine_man_pages()
134+
135+
# -- Options for sphinx_copybutton ----------------------------------------------------
136+
137+
copybutton_prompt_text = r"\$ | C\:\> "
138+
copybutton_prompt_is_regexp = True
139+
copybutton_only_copy_prompt_lines = False

news/11702.trivial.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Strip command line prompts like "$" and "C:>" from the actual command
2+
being copied using the copybutton.

0 commit comments

Comments
 (0)