Skip to content
New issue

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

add sphinx-copybutton configurations to exclude prompts #59370

Closed
wants to merge 3 commits into from

Conversation

mosc9575
Copy link
Contributor

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preferred solution would be to add back sphinx-togglepromt so users have the choice whether to copy the prompt or not

@mosc9575
Copy link
Contributor Author

mosc9575 commented Aug 1, 2024

It is easy to combine the extensions sphinx_copybutton and sphinx_toggleprompt, but sphinx_toggleprompt doesn't support the ipython layout. See a minimal example I made with the code from the beginners section.

grafik

If the regular expression from sphinx_copybutton isn't activated, it is not possible to copy the code from the first block to the clipboard without the output lines. This is not user friendly.

Combining these two extensions for a supported layout will result in two clicks for the user to copy the code. And in my humble opinion this is one click to much.

@mosc9575 mosc9575 requested a review from mroeschke August 7, 2024 19:07
@mosc9575
Copy link
Contributor Author

@mroeschke Could you please give me some feedback to the current version. Otherwise I am about to close this PR, because it is out of my personal scope.

@mosc9575 mosc9575 closed this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Add automatic exclusion of prompts from the copies using sphinx-copybutton
2 participants