@@ -75,6 +75,7 @@ public string NormalizeDescription(string content)
7575 /// <summary>
7676 /// Converts description text for code generation output.
7777 /// Transforms [enum: Name] and [struct: Name] to {@link Name} for JSDoc.
78+ /// Formats [note:], [warning:], [info:], [danger:] as readable callouts.
7879 /// </summary>
7980 public static string FormatDescriptionForCodeGen ( string ? content )
8081 {
@@ -87,9 +88,33 @@ public static string FormatDescriptionForCodeGen(string? content)
8788 // Convert [struct: Name] to {@link Name}
8889 result = StructAttributeRegex ( ) . Replace ( result , "{@link $1}" ) ;
8990
91+ // Format callouts as @remarks tags (JSDoc/TypeDoc compatible)
92+ result = NoteAttributeRegex ( ) . Replace ( result , m => FormatCalloutAsRemarks ( m . Groups [ 1 ] . Value ) ) ;
93+ result = WarningAttributeRegex ( ) . Replace ( result , m => FormatCalloutAsRemarks ( m . Groups [ 1 ] . Value , "Warning" ) ) ;
94+ result = InfoAttributeRegex ( ) . Replace ( result , m => FormatCalloutAsRemarks ( m . Groups [ 1 ] . Value ) ) ;
95+ result = DangerAttributeRegex ( ) . Replace ( result , m => FormatCalloutAsRemarks ( m . Groups [ 1 ] . Value , "Danger" ) ) ;
96+
9097 return result ;
9198 }
9299
100+ private static string FormatCalloutAsRemarks ( string content , string ? prefix = null )
101+ {
102+ var trimmed = content . Trim ( ) ;
103+ // Check for title | description format
104+ var pipeIndex = trimmed . IndexOf ( '|' ) ;
105+ if ( pipeIndex >= 0 )
106+ {
107+ var title = trimmed [ ..pipeIndex ] . Trim ( ) ;
108+ var description = trimmed [ ( pipeIndex + 1 ) ..] . Trim ( ) ;
109+ trimmed = $ "{ title } : { description } ";
110+ }
111+
112+ // Add newlines before and after to separate from surrounding text
113+ return prefix != null
114+ ? $ "\n @remarks **{ prefix } :** { trimmed } \n "
115+ : $ "\n @remarks { trimmed } \n ";
116+ }
117+
93118 public List < EmbeddedEnumRef > ParseEmbeddedEnums ( string content )
94119 {
95120 var results = new List < EmbeddedEnumRef > ( ) ;
0 commit comments