Patchwork [U-Boot,3/4,V3] kerneldoc: Implement "Example" section handling

login
register
mail settings
Submitter Marek Vasut
Date Oct. 7, 2012, 12:05 a.m.
Message ID <1349568301-27116-3-git-send-email-marex@denx.de>
Download mbox | patch
Permalink /patch/189766/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Marek Vasut - Oct. 7, 2012, 12:05 a.m.
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 |    3 +++
 1 file changed, 3 insertions(+)

V3:
- Make use of patman tags in commit description
- Push the patches to testing:
	http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/dm-kerneldoc

V2:
- Resend

Patch

diff --git a/tools/kernel-doc/kernel-doc b/tools/kernel-doc/kernel-doc
index 8848efd..6347418 100755
--- a/tools/kernel-doc/kernel-doc
+++ b/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";
 		}