Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-107024 Added copy button to code snippets in documentation#107037

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
churnikov wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromchurnikov:gh-107024-copy-button

Conversation

churnikov
Copy link

@churnikovchurnikov commentedJul 22, 2023
edited by github-actionsbot
Loading

I added sphinx-copybutton to documentation dependencies, which results in the following button in code snippets
image

If this is a right thing to do, then this requires a bit more work, as this right now copies the whole code block, but it could be changed through configuration.
It also overrides>>> toggle button where applicable. This has to be fixed or decided to be dropped and made so that copy button copies code without>>> and output.

image

📚 Documentation preview 📚:https://cpython-previews--107037.org.readthedocs.build/

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@ghost
Copy link

ghost commentedJul 22, 2023
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@churnikovchurnikov marked this pull request as ready for reviewJuly 23, 2023 11:21
@AA-Turner
Copy link
Member

AA-Turner commentedJul 27, 2023
edited
Loading

We could add this topython-docs-theme instead, to have all users of that theme benefit from this change? That would also enable making the necessary styling changes in one place.

A

@@ -22,6 +22,7 @@
'pyspecific',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx_copybutton',
Copy link
Member

Choose a reason for hiding this comment

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

We've been cautious about including third-party extensions, in case downstream redistributors haven't installed them. See the try/except block just below for sphinxext.opengraph.

All the others here are Sphinx builtin extensions, or our own custom ones.

ezio-melotti reacted with thumbs up emoji
@@ -36,3 +36,4 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
urllib3==1.26.15
sphinx-copybutton<0.6
Copy link
Member

Choose a reason for hiding this comment

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

This file is meant to be a generated list of pinned dependencies, see instructions at the top.

@@ -12,6 +12,7 @@ sphinx==6.2.0
blurb

sphinxext-opengraph==0.7.5
sphinx-copybutton<0.6
Copy link
Member

Choose a reason for hiding this comment

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

Why the upper version limit?

@churnikov
Copy link
Author

#107037 (comment)

Sure, I could do that if think that would be better

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hugovkhugovkhugovk left review comments

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

@ezio-melottiezio-melottiAwaiting requested review from ezio-melotti

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@churnikov@bedevere-bot@AA-Turner@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp