Skip to contentSkip to conversation

docs: examples of pages affected by inline literal overflow

PATCH In review Rito Rhymes 3 participants 7 messages Mar 21 – Mar 25 Documentation

lore
Share & tools
lore
#0 lore raw

cover docs: examples of pages affected by inline literal overflow

Examples of affected pages on docs.kernel.org this patch improves:
userspace-api/futex2.html userspace-api/seccomp_filter.html hid/intel-ish-hid.html
hid/hid-bpf.html userspace-api/media/v4l/ext-ctrls-codec.html core-api/dma-api-howto.html security/IMA-templates.html virt/kvm/arm/hypercalls.html hwmon/hp-wmi-sensors.html
bpf/map_devmap.html

Rito Rhymes (1):
docs: allow inline literals in paragraphs to wrap to prevent overflow

 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/1 docs: allow inline literals in paragraphs to wrap to prevent overflow

Some documentation pages contain long inline literals in paragraph text that can force page-wide horizontal scroll overflow and break layout on smaller screens.

Override the default span.pre white-space behavior for inline literals and use overflow-wrap: anywhere so they can wrap when needed. For code used as part of a paragraph, wrapping is appropriate because it is stylistically part of the surrounding text. Code blocks, by contrast, are meant to preserve formatting fidelity and are better served by contained horizontal scrolling.

---
 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/sphinx-static/custom.css +9 -0
index db24f4344..dd69df2a7 100644
@@ -149,6 +149,15 @@ div.language-selection ul li:hover {
     background: #dddddd;
 }
 
+/*
+ * Let long inline literals in paragraph text wrap as needed to prevent
+ * overflow.
+ */
+code.docutils.literal span.pre {
+    white-space: normal;
+    overflow-wrap: anywhere;
+}
+
 /* Make xrefs more universally visible */
 a.reference, a.reference:hover {
     border-bottom: none;
Signature · 1 line
2.51.0
reviewer Tested-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] docs: allow inline literals in paragraphs to wrap to prevent overflow

Quoted 4 lines · Rito Rhymes

Some documentation pages contain long inline literals in paragraph text that can force page-wide horizontal scroll overflow and break layout on smaller screens.

Quoted 8 lines

Override the default span.pre white-space behavior for inline literals and use overflow-wrap: anywhere so they can wrap when needed. For code used as part of a paragraph, wrapping is appropriate because it is stylistically part of the surrounding text. Code blocks, by contrast, are meant to preserve formatting fidelity and are better served by contained horizontal scrolling.

Thanks.

Quoted 4 lines
---
 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
~Randy
#3 lore raw

v2 cover docs: examples of pages affected by inline literal overflow

In reply to Rito Rhymes

Examples of affected pages on docs.kernel.org this patch improves:
userspace-api/futex2.html userspace-api/seccomp_filter.html hid/intel-ish-hid.html
hid/hid-bpf.html userspace-api/media/v4l/ext-ctrls-codec.html core-api/dma-api-howto.html security/IMA-templates.html virt/kvm/arm/hypercalls.html hwmon/hp-wmi-sensors.html
bpf/map_devmap.html

Rito Rhymes (1):
docs: allow inline literals in paragraphs to wrap to prevent overflow

 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
2.51.0
#4 lore raw

PATCH v2 1/1 docs: allow inline literals in paragraphs to wrap to prevent overflow

Some documentation pages contain long inline literals in paragraph text that can force page-wide horizontal scroll overflow and break layout on smaller screens.

Override the default span.pre white-space behavior for inline literals and use overflow-wrap: anywhere so they can wrap when needed. For code used as part of a paragraph, wrapping is appropriate because it is stylistically part of the surrounding text. Code blocks, by contrast, are meant to preserve formatting fidelity and are better served by contained horizontal scrolling.

Assisted-by Codex:GPT-5.4

---
v2: add Assisted-by attribution

 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/sphinx-static/custom.css +9 -0
index db24f4344..dd69df2a7 100644
@@ -149,6 +149,15 @@ div.language-selection ul li:hover {
     background: #dddddd;
 }
 
+/*
+ * Let long inline literals in paragraph text wrap as needed to prevent
+ * overflow.
+ */
+code.docutils.literal span.pre {
+    white-space: normal;
+    overflow-wrap: anywhere;
+}
+
 /* Make xrefs more universally visible */
 a.reference, a.reference:hover {
     border-bottom: none;
Signature · 1 line
2.51.0
#5 lore raw

PATCH v3 1/1 docs: allow inline literals in paragraphs to wrap to prevent overflow

In reply to Rito Rhymes

Some documentation pages contain long inline literals in paragraph text that can force page-wide horizontal scroll overflow and break layout on smaller screens.

Override the default span.pre white-space behavior for inline literals and use overflow-wrap: anywhere so they can wrap when needed. For code used as part of a paragraph, wrapping is appropriate because it is stylistically part of the surrounding text. Code blocks, by contrast, are meant to preserve formatting fidelity and are better served by contained horizontal scrolling.

Examples:
https://docs.kernel.org/6.15/userspace-api/futex2.html
https://docs.kernel.org/6.15/security/IMA-templates.html

Assisted-by Codex:GPT-5.4

---
v3: add latest public versioned URL examples to the patchlog

 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/sphinx-static/custom.css +9 -0
index db24f4344..dd69df2a7 100644
@@ -149,6 +149,15 @@ div.language-selection ul li:hover {
     background: #dddddd;
 }
 
+/*
+ * Let long inline literals in paragraph text wrap as needed to prevent
+ * overflow.
+ */
+code.docutils.literal span.pre {
+    white-space: normal;
+    overflow-wrap: anywhere;
+}
+
 /* Make xrefs more universally visible */
 a.reference, a.reference:hover {
     border-bottom: none;
Signature · 1 line
2.51.0
maintainer
#6 lore raw

Re: [PATCH v3] docs: allow inline literals in paragraphs to wrap to prevent overflow

Quoted 15 lines · Rito Rhymes

Some documentation pages contain long inline literals in paragraph text that can force page-wide horizontal scroll overflow and break layout on smaller screens.

Override the default span.pre white-space behavior for inline literals and use overflow-wrap: anywhere so they can wrap when needed. For code used as part of a paragraph, wrapping is appropriate because it is stylistically part of the surrounding text. Code blocks, by contrast, are meant to preserve formatting fidelity and are better served by contained horizontal scrolling.

Examples:
https://docs.kernel.org/6.15/userspace-api/futex2.html
https://docs.kernel.org/6.15/security/IMA-templates.html

Quoted 7 lines
Assisted-by Codex:GPT-5.4

---
v3: add latest public versioned URL examples to the patchlog

 Documentation/sphinx-static/custom.css | 9 +++++++++
 1 file changed, 9 insertions(+)

I have applied this one as well.

Thanks,

jon