aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 2dea5f81baef..c7109ca40ba4 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -230,6 +230,7 @@ my $dohighlight = "";
230 230
231my $verbose = 0; 231my $verbose = 0;
232my $output_mode = "man"; 232my $output_mode = "man";
233my $output_preformatted = 0;
233my $no_doc_sections = 0; 234my $no_doc_sections = 0;
234my %highlights = %highlights_man; 235my %highlights = %highlights_man;
235my $blankline = $blankline_man; 236my $blankline = $blankline_man;
@@ -460,7 +461,9 @@ sub output_highlight {
460 461
461 foreach $line (split "\n", $contents) { 462 foreach $line (split "\n", $contents) {
462 if ($line eq ""){ 463 if ($line eq ""){
463 print $lineprefix, local_unescape($blankline); 464 if (! $output_preformatted) {
465 print $lineprefix, local_unescape($blankline);
466 }
464 } else { 467 } else {
465 $line =~ s/\\\\\\/\&/g; 468 $line =~ s/\\\\\\/\&/g;
466 if ($output_mode eq "man" && substr($line, 0, 1) eq ".") { 469 if ($output_mode eq "man" && substr($line, 0, 1) eq ".") {
@@ -643,10 +646,12 @@ sub output_section_xml(%) {
643 print "<title>$section</title>\n"; 646 print "<title>$section</title>\n";
644 if ($section =~ m/EXAMPLE/i) { 647 if ($section =~ m/EXAMPLE/i) {
645 print "<informalexample><programlisting>\n"; 648 print "<informalexample><programlisting>\n";
649 $output_preformatted = 1;
646 } else { 650 } else {
647 print "<para>\n"; 651 print "<para>\n";
648 } 652 }
649 output_highlight($args{'sections'}{$section}); 653 output_highlight($args{'sections'}{$section});
654 $output_preformatted = 0;
650 if ($section =~ m/EXAMPLE/i) { 655 if ($section =~ m/EXAMPLE/i) {
651 print "</programlisting></informalexample>\n"; 656 print "</programlisting></informalexample>\n";
652 } else { 657 } else {
@@ -949,10 +954,12 @@ sub output_blockhead_xml(%) {
949 } 954 }
950 if ($section =~ m/EXAMPLE/i) { 955 if ($section =~ m/EXAMPLE/i) {
951 print "<example><para>\n"; 956 print "<example><para>\n";
957 $output_preformatted = 1;
952 } else { 958 } else {
953 print "<para>\n"; 959 print "<para>\n";
954 } 960 }
955 output_highlight($args{'sections'}{$section}); 961 output_highlight($args{'sections'}{$section});
962 $output_preformatted = 0;
956 if ($section =~ m/EXAMPLE/i) { 963 if ($section =~ m/EXAMPLE/i) {
957 print "</para></example>\n"; 964 print "</para></example>\n";
958 } else { 965 } else {
@@ -1028,10 +1035,12 @@ sub output_function_gnome {
1028 print "<simplesect>\n <title>$section</title>\n"; 1035 print "<simplesect>\n <title>$section</title>\n";
1029 if ($section =~ m/EXAMPLE/i) { 1036 if ($section =~ m/EXAMPLE/i) {
1030 print "<example><programlisting>\n"; 1037 print "<example><programlisting>\n";
1038 $output_preformatted = 1;
1031 } else { 1039 } else {
1032 } 1040 }
1033 print "<para>\n"; 1041 print "<para>\n";
1034 output_highlight($args{'sections'}{$section}); 1042 output_highlight($args{'sections'}{$section});
1043 $output_preformatted = 0;
1035 print "</para>\n"; 1044 print "</para>\n";
1036 if ($section =~ m/EXAMPLE/i) { 1045 if ($section =~ m/EXAMPLE/i) {
1037 print "</programlisting></example>\n"; 1046 print "</programlisting></example>\n";