Преглед на файлове

kerneldoc: Implement "Example" section handling

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>
Marek Vasut преди 12 години
родител
ревизия
95d45a91d7
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      tools/kernel-doc/kernel-doc

+ 3 - 0
tools/kernel-doc/kernel-doc

@@ -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";
 		}