public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Rito Rhymes <rito@ritovision.com>, skhan@linuxfoundation.org
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rito Rhymes <rito@ritovision.com>
Subject: Re: [PATCH] docs: add copy buttons for code blocks
Date: Mon, 30 Mar 2026 09:40:05 -0600	[thread overview]
Message-ID: <874ilxpbqi.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20260329214816.10553-1-rito@ritovision.com>

Rito Rhymes <rito@ritovision.com> writes:

> Add a copy button to highlighted code blocks in the documentation
> that copies the full contents of the code block to the clipboard.
>
> This is faster and less error-prone than manually selecting and
> copying code from the page, especially for longer examples where
> part of the block can be accidentally missed.
>
> Keep the control hidden until the user interacts with the block so
> it stays out of the way during normal reading. Reveal it on hover,
> focus, and touch interaction, then copy the block contents to the
> clipboard with a small success or failure state.
>
> Signed-off-by: Rito Rhymes <rito@ritovision.com>
> Assisted-by: Codex:GPT-5.4
> Assisted-by: Claude Opus 4.6
> ---
> Live demo:
> https://kernel-docs-cp.ritovision.com/accounting/delay-accounting.html

Honestly, I don't think so.

Rito, who is asking for this feature?  What is the use case?  Does it
really justify adding a blob of JavaScript code to every view of the
kernel documentation - JavaScript that we will have to maintain going
forward?

Our goal here is to make the kernel documentation better, not to shovel
lots of code into the repository.

If you can get some acks from established kernel developers saying that
they want this change, I will reconsider - but only after the merge
window.  But I really think that, again, this is something you might
want to discuss with the Sphinx developers, then turn it into something
without hard-coded colors that will work with whatever theme people
might choose to build their docs with.

jon

      reply	other threads:[~2026-03-30 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-29 21:48 [PATCH] docs: add copy buttons for code blocks Rito Rhymes
2026-03-30 15:40 ` Jonathan Corbet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ilxpbqi.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rito@ritovision.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox