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>, linux-doc@vger.kernel.org
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, rdunlap@infradead.org,
	Rito Rhymes <rito@ritovision.com>
Subject: Re: [PATCH v3] docs: contain horizontal overflow in C API descriptions
Date: Wed, 25 Mar 2026 13:00:01 -0600	[thread overview]
Message-ID: <87jyuzg2fi.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20260323153342.33447-1-rito@ritovision.com>

Rito Rhymes <rito@ritovision.com> writes:

> Some documentation pages contain long C API signatures that can exceed
> the content width and cause page-wide horizontal scroll overflow.
>
> Apply contained horizontal scrolling to C API description blocks and
> keep their signature rows on one line. This preserves signature
> formatting while preventing them from breaking page layout.
>
> Contained horizontal scrolling is preferred over wrapping here because
> code fidelity is the priority. These blocks are intended to remain
> representative of the code itself. Wrapping distorts spacing and line
> structure, which affects fidelity, creates misleading renderings, and
> reduces readability.
>
> Examples:
>   https://docs.kernel.org/6.15/driver-api/regulator.html
>   https://docs.kernel.org/6.15/userspace-api/fwctl/fwctl-cxl.html
>
> Signed-off-by: Rito Rhymes <rito@ritovision.com>
> Assisted-by: Codex:GPT-5.4
> ---
> v3: add latest public versioned URL examples to the patchlog
>
>  Documentation/sphinx-static/custom.css | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css
> index db24f4344..18bf8813b 100644
> --- a/Documentation/sphinx-static/custom.css
> +++ b/Documentation/sphinx-static/custom.css
> @@ -40,6 +40,13 @@ li { text-indent: 0em; }
>  dl.function, dl.struct, dl.enum { margin-top: 2em; background-color: #ecf0f3; }
>  /* indent lines 2+ of multi-line function prototypes */
>  dl.function dt { margin-left: 10em; text-indent: -10em; }
> +/*
> + * Preserve C API signatures on one line and apply contained horizontal
> + * scrolling to prevent them from exceeding their container width and
> + * breaking page layout.
> + */
> +dl.c { overflow-x: auto; overflow-y: hidden; }
> +dl.c > dt.sig.sig-object { white-space: nowrap; }
>  dt.sig-object { font-size: larger; }

I am not convinced this is the best solution to the problem; somebody
looking at this documentation is going to want to see the prototype, and
reaching over for horizontal scrolling will not be entirely welcome.

I guess, though, that it's better than what we have now, so I have
applied this one.

Thanks,

jon

  reply	other threads:[~2026-03-25 19:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 14:25 [PATCH 0/1] docs: examples of pages affected by C API signature overflow Rito Rhymes
2026-03-21 14:25 ` [PATCH 1/1] docs: contain horizontal overflow in C API descriptions Rito Rhymes
2026-03-21 21:12   ` Randy Dunlap
2026-03-22 19:37   ` [PATCH v2 0/1] docs: examples of pages affected by C API signature overflow Rito Rhymes
2026-03-22 19:37     ` [PATCH v2 1/1] docs: contain horizontal overflow in C API descriptions Rito Rhymes
2026-03-22 20:35     ` [PATCH v2 0/1] docs: examples of pages affected by C API signature overflow Jonathan Corbet
2026-03-23  9:57       ` Rito Rhymes
2026-03-23 13:42         ` Jonathan Corbet
2026-03-23 15:33   ` [PATCH v3] docs: contain horizontal overflow in C API descriptions Rito Rhymes
2026-03-25 19:00     ` Jonathan Corbet [this message]
2026-03-25 20:50       ` Rito Rhymes
2026-03-25 21:14         ` Jonathan Corbet
2026-03-26 19:10           ` Rito Rhymes
2026-03-26 18:43   ` [PATCH v4] docs: wrap long C API signatures to prevent page overflow Rito Rhymes

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=87jyuzg2fi.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.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