[PATCH v3 1/2] docs: allow long links to wrap per character to prevent page overflow

Rito Rhymes posted 2 patches 1 week, 6 days ago
There is a newer version of this series
[PATCH v3 1/2] docs: allow long links to wrap per character to prevent page overflow
Posted by Rito Rhymes 1 week, 4 days ago
Some documentation pages contain long link text without natural
break points, which can force page-wide horizontal scroll overflow
on small screens.

Use overflow-wrap: anywhere for anchor text in the docs stylesheet so
links can wrap per character as a fallback when normal word boundaries
are unavailable.

Examples:
  https://docs.kernel.org/6.15/firmware-guide/acpi/non-d0-probe.html
  https://docs.kernel.org/6.15/arch/x86/earlyprintk.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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css
index db24f4344..4ec617d40 100644
--- a/Documentation/sphinx-static/custom.css
+++ b/Documentation/sphinx-static/custom.css
@@ -149,6 +149,11 @@ div.language-selection ul li:hover {
     background: #dddddd;
 }
 
+/* Let long link text wrap instead of forcing overflow. */
+a {
+    overflow-wrap: anywhere;
+}
+
 /* Make xrefs more universally visible */
 a.reference, a.reference:hover {
     border-bottom: none;
-- 
2.51.0
Re: [PATCH v3 1/2] docs: allow long links to wrap per character to prevent page overflow
Posted by Jonathan Corbet 1 week, 2 days ago
Rito Rhymes <rito@ritovision.com> writes:

> Some documentation pages contain long link text without natural
> break points, which can force page-wide horizontal scroll overflow
> on small screens.
>
> Use overflow-wrap: anywhere for anchor text in the docs stylesheet so
> links can wrap per character as a fallback when normal word boundaries
> are unavailable.
>
> Examples:
>   https://docs.kernel.org/6.15/firmware-guide/acpi/non-d0-probe.html
>   https://docs.kernel.org/6.15/arch/x86/earlyprintk.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 | 5 +++++
>  1 file changed, 5 insertions(+)

With these two I at least see the problem - on Chrome, at least; Firefox
does a better job of it.  Again I'm not convinced this is optimal, but
I've applied them as being better than what we have.

Thanks,

jon
Re: [PATCH v3 1/2] docs: allow long links to wrap per character to prevent page overflow
Posted by Randy Dunlap 1 week, 2 days ago

On 3/23/26 8:24 AM, Rito Rhymes wrote:
> Some documentation pages contain long link text without natural
> break points, which can force page-wide horizontal scroll overflow
> on small screens.
> 
> Use overflow-wrap: anywhere for anchor text in the docs stylesheet so
> links can wrap per character as a fallback when normal word boundaries
> are unavailable.
> 
> Examples:
>   https://docs.kernel.org/6.15/firmware-guide/acpi/non-d0-probe.html
>   https://docs.kernel.org/6.15/arch/x86/earlyprintk.html
> 
> Signed-off-by: Rito Rhymes <rito@ritovision.com>
> Assisted-by: Codex:GPT-5.4

Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

> ---
> v3: add latest public versioned URL examples to the patchlog
> 
>  Documentation/sphinx-static/custom.css | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css
> index db24f4344..4ec617d40 100644
> --- a/Documentation/sphinx-static/custom.css
> +++ b/Documentation/sphinx-static/custom.css
> @@ -149,6 +149,11 @@ div.language-selection ul li:hover {
>      background: #dddddd;
>  }
>  
> +/* Let long link text wrap instead of forcing overflow. */
> +a {
> +    overflow-wrap: anywhere;
> +}
> +
>  /* Make xrefs more universally visible */
>  a.reference, a.reference:hover {
>      border-bottom: none;

-- 
~Randy
[PATCH v3 2/2] docs: allow long table reference links to wrap and prevent overflow
Posted by Rito Rhymes 1 week, 4 days ago
Some documentation pages contain docutils tables with reference links
that use long unbroken strings. Those strings can expand the table
width beyond the content column and cause page-wide horizontal
overflow.

Allow reference links in docutils tables in the main document body to
wrap when needed so the table stays within the content column and does
not break page layout.

Examples:
  https://docs.kernel.org/6.15/arch/openrisc/openrisc_port.html
  https://docs.kernel.org/6.15/filesystems/ext2.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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css
index 4ec617d40..b41c54c71 100644
--- a/Documentation/sphinx-static/custom.css
+++ b/Documentation/sphinx-static/custom.css
@@ -154,6 +154,11 @@ a {
     overflow-wrap: anywhere;
 }
 
+/* Let rendered reference links in tables wrap when needed. */
+div.body table.docutils a.reference {
+    overflow-wrap: anywhere;
+}
+
 /* Make xrefs more universally visible */
 a.reference, a.reference:hover {
     border-bottom: none;
-- 
2.51.0
Re: [PATCH v3 2/2] docs: allow long table reference links to wrap and prevent overflow
Posted by Randy Dunlap 1 week, 2 days ago

On 3/23/26 8:24 AM, Rito Rhymes wrote:
> Some documentation pages contain docutils tables with reference links
> that use long unbroken strings. Those strings can expand the table
> width beyond the content column and cause page-wide horizontal
> overflow.
> 
> Allow reference links in docutils tables in the main document body to
> wrap when needed so the table stays within the content column and does
> not break page layout.
> 
> Examples:
>   https://docs.kernel.org/6.15/arch/openrisc/openrisc_port.html
>   https://docs.kernel.org/6.15/filesystems/ext2.html
> 
> Signed-off-by: Rito Rhymes <rito@ritovision.com>
> Assisted-by: Codex:GPT-5.4

Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

> ---
> v3: add latest public versioned URL examples to the patchlog
> 
>  Documentation/sphinx-static/custom.css | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css
> index 4ec617d40..b41c54c71 100644
> --- a/Documentation/sphinx-static/custom.css
> +++ b/Documentation/sphinx-static/custom.css
> @@ -154,6 +154,11 @@ a {
>      overflow-wrap: anywhere;
>  }
>  
> +/* Let rendered reference links in tables wrap when needed. */
> +div.body table.docutils a.reference {
> +    overflow-wrap: anywhere;
> +}
> +
>  /* Make xrefs more universally visible */
>  a.reference, a.reference:hover {
>      border-bottom: none;

-- 
~Randy