We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
context You can configure. The can should be demonstrated.
expectation Install should produce 3rd example. Requires a Minimal Working Example.
bug Default install strips nothing
problem Example is non-functional
Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32 Running Sphinx v6.2.1
The text was updated successfully, but these errors were encountered:
Example at https://sphinx-copybutton.readthedocs.io/:
>>> a = 2 >>> print(a) 2 >>> >>> b = 'wow' >>> print(b) wow
copy/paste gives:
a = 2 print(a) b = 'wow' print(b)
Blank lines are an important part of code and should not be stripped or require Using regexp prompt identifiers.
These two parts as documented don't work together:
https://sphinx-copybutton.readthedocs.io/en/latest/use.html#automatic-exclusion-of-prompts-from-the-copies
... To make sphinx-copybutton skip all prompt characters generated by pygments, use the following setting: copybutton_exclude = '.linenos, .gp' To skip all console outputs, add .go to the string above.
... To make sphinx-copybutton skip all prompt characters generated by pygments, use the following setting:
copybutton_exclude = '.linenos, .gp'
To skip all console outputs, add .go to the string above.
https://sphinx-copybutton.readthedocs.io/en/latest/use.html#keep-empty-lines
By default, sphinx-copybutton will also copy / pass through empty lines, determined by line.trim() === ''.
blank lines are retained with conf.py using >>> ?:
conf.py
>>> ?
# copybutton_exclude = '.linenos, .gp, .go' copybutton_prompt_text = r">>> ?|\.\.\. ?|\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " copybutton_prompt_is_regexp = True
gives:
Sorry, something went wrong.
Also fails with ...:
...
>>> for i in (1,2): ... print(i) ... >>> # Loop finished >>> >>> # Blank line above
No branches or pull requests
Describe the bug
context
You can configure. The can should be demonstrated.
expectation
Install should produce 3rd example. Requires a Minimal Working Example.
bug
Default install strips nothing
problem
Example is non-functional
Reproduce the bug
List your environment
Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32
Running Sphinx v6.2.1
The text was updated successfully, but these errors were encountered: