kerneldoc: Implement "Example" section handling
authorMarek Vasut <marex@denx.de>
Sat, 6 Oct 2012 14:05:00 +0000 (14:05 +0000)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 18:54:15 +0000 (11:54 -0700)
The default kernel-doc strips starting spaces from every single
line in the Example section. This makes the code look bad. Thus,
implement special handling for this section.

Signed-off-by: Marek Vasut <marex@denx.de>
tools/kernel-doc/kernel-doc

index 8848efd8eda3f9860e2fe017526d343b9c4c7110..6347418904811d60c3ba316653c2d931a3baea7b 100755 (executable)
@@ -2424,6 +2424,9 @@ sub process_file($) {
                    # Continued declaration purpose
                    chomp($declaration_purpose);
                    $declaration_purpose .= " " . xml_escape($1);
+               } elsif ($section =~ m/^Example/) {
+                   $_ =~ s/^\s*\*//;
+                   $contents .= $_;
                } else {
                    $contents .= $1 . "\n";
                }