Skip to contentSkip to conversation

docs: Makefile: wrap SPHINXDIRS help text

PATCH Superseded [email protected] 3 participants 5 messages Dec 26, 2025 – Jan 6 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 docs: Makefile: wrap SPHINXDIRS help text

From: Mustafa Elrasheid <[email protected]>

When using make help, SPHINXDIR doesn't wrap around 80 characters, causing text to overflow or wrap in incorrect ways,
which then makes the text difficult to read

---
v2:
- Added '-s' in fmt to prevent word segmenting at the end of lines.
- Reduced width in fmt -w to account for the added indentation of

    `sed`
 Documentation/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/Makefile +1 -1
index e96ac6dcac4f..e260df866f5e 100644
@@ -98,7 +98,7 @@ dochelp:
 	@echo  '  cleandocs       - clean all generated files'
 	@echo
 	@echo  '  make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
-	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)'
+	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)' | fmt -s -w 72 | sed '1!s/^/    /'
 	@echo  '  you may also use a subdirectory like SPHINXDIRS=userspace-api/media,'
 	@echo  '  provided that there is an index.rst file at the subdirectory.'
 	@echo
Signature · 1 line
2.39.5
reviewer
#1 lore raw

Hi,

Quoted 21 lines · On 12/26/25 12:56 AM, [email protected] wrote:

From: Mustafa Elrasheid <[email protected]>

When using make help, SPHINXDIR doesn't wrap around 80 characters, causing text to overflow or wrap in incorrect ways,
which then makes the text difficult to read

---
v2:
- Added '-s' in fmt to prevent word segmenting at the end of lines.
- Reduced width in fmt -w to account for the added indentation of

    `sed`
 Documentation/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/Makefile +0 -0
index e96ac6dcac4f..e260df866f5e 100644

Documentation/Makefile dochelp: · line 104

Quoted 8 lines
Documentation/Makefile +1 -1
@@ -98,7 +98,7 @@ dochelp:
 	@echo  '  cleandocs       - clean all generated files'
 	@echo
 	@echo  '  make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
-	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)'
+	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)' | fmt -s -w 72 | sed '1!s/^/    /'
 	@echo  '  you may also use a subdirectory like SPHINXDIRS=userspace-api/media,'
 	@echo  '  provided that there is an index.rst file at the subdirectory.'
 	@echo

OK, that works.
I think that the output can be made a little nicer to look at like this:

@@ -98,7 +101,8 @@ dochelp:
@echo ' cleandocs - clean all generated files'
@echo

 	@echo  '  make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
-	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)'
+	@echo  '  top level values for SPHINXDIRS are:'
+	@echo  '$(_SPHINXDIRS)' | fmt -s -w 75 -g 75 | sed 's/^/    /'
 	@echo  '  you may also use a subdirectory like SPHINXDIRS=userspace-api/media,'
 	@echo  '  provided that there is an index.rst file at the subdirectory.'

@echo

although I would rather not assume a terminal width of 80.

thanks.

Signature · 1 line
~Randy
#2 lore raw

PATCH v3 1/1 docs: Makefile: wrap SPHINXDIRS help text

From: Mustafa Elrasheid <[email protected]>

When using make help, SPHINXDIR doesn't wrap around 80 characters, causing text to overflow or wrap in incorrect ways,
which then makes the text difficult to read

---
v3:
- Moved SPHINXDIRS to a new line for better readability
- Added -g 75 to increase the goal of fmt instead of 93% of -w 75
v2:
- Added '-s' in fmt to prevent word segmenting at the end of lines.
- Reduced width in fmt -w to account for the added indentation of

    `sed`
 Documentation/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/Makefile +2 -1
index e96ac6dcac4f..377a449656c8 100644
@@ -98,7 +98,8 @@ dochelp:
 	@echo  '  cleandocs       - clean all generated files'
 	@echo
 	@echo  '  make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
-	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)'
+	@echo  '  top level values for SPHINXDIRS are:'
+	@echo  '$(_SPHINXDIRS)' | fmt -s -w 75 -g 75 | sed 's/^/    /'
 	@echo  '  you may also use a subdirectory like SPHINXDIRS=userspace-api/media,'
 	@echo  '  provided that there is an index.rst file at the subdirectory.'
 	@echo
Signature · 1 line
2.39.5
reviewer Acked-by Tested-by on v3 1/1
#3 lore raw
Quoted 7 lines · On 12/27/25 4:52 AM, [email protected] wrote:

From: Mustafa Elrasheid <[email protected]>

When using make help, SPHINXDIR doesn't wrap around 80 characters, causing text to overflow or wrap in incorrect ways,
which then makes the text difficult to read

Thanks.

Quoted 26 lines

---
v3:
- Moved SPHINXDIRS to a new line for better readability
- Added -g 75 to increase the goal of fmt instead of 93% of -w 75
v2:
- Added '-s' in fmt to prevent word segmenting at the end of lines.
- Reduced width in fmt -w to account for the added indentation of

    `sed`
 Documentation/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/Makefile +2 -1
index e96ac6dcac4f..377a449656c8 100644
@@ -98,7 +98,8 @@ dochelp:
 	@echo  '  cleandocs       - clean all generated files'
 	@echo
 	@echo  '  make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
-	@echo  '  top level values for SPHINXDIRS are: $(_SPHINXDIRS)'
+	@echo  '  top level values for SPHINXDIRS are:'
+	@echo  '$(_SPHINXDIRS)' | fmt -s -w 75 -g 75 | sed 's/^/    /'
 	@echo  '  you may also use a subdirectory like SPHINXDIRS=userspace-api/media,'
 	@echo  '  provided that there is an index.rst file at the subdirectory.'
 	@echo
Signature · 1 line
~Randy
maintainer Applied
#4 lore raw
In reply to [email protected]
Quoted 14 lines · [email protected] writes:

From: Mustafa Elrasheid <[email protected]>

When using make help, SPHINXDIR doesn't wrap around 80 characters, causing text to overflow or wrap in incorrect ways,
which then makes the text difficult to read

---
v3:
- Moved SPHINXDIRS to a new line for better readability
- Added -g 75 to increase the goal of fmt instead of 93% of -w 75
v2:
- Added '-s' in fmt to prevent word segmenting at the end of lines.
- Reduced width in fmt -w to account for the added indentation of

Quoted 4 lines
    `sed`
 Documentation/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

jon