makedoc: Promote "EXAMPLE" to introducing a subsection

Message ID 20260619135712.73903-1-jon.turney@dronecode.org.uk
State New
Headers
Series makedoc: Promote "EXAMPLE" to introducing a subsection |

Commit Message

Jon Turney June 19, 2026, 1:57 p.m. UTC
  Handle "EXAMPPLE" as introducing an "Example" subsection (of which
there's only one instance presently, in wcwidth).

Retain the existing behaviour of the unused "CODE_FRAGMENT".
---

Notes:
    Future work: "EXAMPLE" is presently ignored in makedocbook, which also
    needs to be fixed.

 newlib/doc/doc.str | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
  

Patch

diff --git a/newlib/doc/doc.str b/newlib/doc/doc.str
index 52d41f245..dccbfa418 100644
--- a/newlib/doc/doc.str
+++ b/newlib/doc/doc.str
@@ -23,20 +23,17 @@ 
 	skip_past_newline
 	;
 
-: EXAMPLE
-	skip_past_newline	
-
-	get_stuff_in_command nokill_bogus_lines translatecomments 
-	courierize catstr
-
-	;
-
 : INODE 
 	"@node " catstr skip_past_newline copy_past_newline catstr 
 	;
 
+- differs from bodytext in that this just courierizes, so content appears more
+- literally (doen't apply bulletize or do_fancy_stuff)
 : CODE_FRAGMENT
-	EXAMPLE 
+	skip_past_newline
+	get_stuff_in_command nokill_bogus_lines translatecomments
+	courierize
+	catstr
 	;
 
 : SYNOPSIS
@@ -144,6 +141,11 @@ 
 : NOTES
 	"@strong{Notes}@*\n" catstr subhead ;
 
+: EXAMPLE
+	"@strong{Example}@*\n" catstr
+	CODE_FRAGMENT
+	;
+
 : INTERNAL_FUNCTION
 	;