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

Add copy button to code blocks#9830

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
Shrikantgiri25 wants to merge2 commits intoencode:main
base:main
Choose a base branch
Loading
fromShrikantgiri25:add-copy-button-to-code-blocks

Conversation

@Shrikantgiri25
Copy link

@Shrikantgiri25Shrikantgiri25 commentedNov 21, 2025
edited
Loading

Description

Currently, code blocks in the DRF documentation must be copied manually. This PR introduces a “Copy” button for code blocks to improve usability.

Scope: Docs-only improvement — does not modify DRF library or API.

Implementation:

Files and Purpose:

1. css/copy-button.css – Styles the copy button, positions it inside code blocks, and applies DRF’s red theme color for consistency.2. js/copy-button.js – Adds a “Copy” button to each <pre><code> block, handles the clipboard copy functionality, and provides user feedback (“Copied!”). 3. mkdocs.yml – Registers the CSS and JS files so they are loaded with the documentation. 4.  main.html – Ensures the extra CSS is included in the page layout.

Discussion -#9829

Screenshots:
image

image

browniebroke reacted with heart emoji
@p-r-a-v-i-n
Copy link
Contributor

I may be completely wrong here, but adding new features or code formatting changes is not allowed according to the DRF policy. This would violate theDRF policy.
As per the policy, DRF is already feature complete. though the requested feature relates to the documentation, it involves code changes, so I don't think it will be accepted.

@Shrikantgiri25
Copy link
Author

I may be completely wrong here, but adding new features or code formatting changes is not allowed according to the DRF policy. This would violate theDRF policy.
As per the policy, DRF is already feature complete. though the requested feature relates to the documentation, it involves code changes, so I don't think it will be accepted.

Thanks for the feedback.
This PR doesn’t introduce any DRF features or library changes.
It only updates the documentation theme (CSS/JS), and DRF’scontributing guide explicitly states that documentation improvements are welcome.
If the maintainers prefer to avoid UX changes in the docs, I’m happy to follow their direction.

browniebroke reacted with thumbs up emoji

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Shrikantgiri25@p-r-a-v-i-n

[8]ページ先頭

©2009-2025 Movatter.jp