]> git.llucax.com Git - software/mutt-debian.git/blobdiff - doc/gen-map-doc
Imported Upstream version 1.5.21
[software/mutt-debian.git] / doc / gen-map-doc
index fcbaeffb0295fc45411742eac91419135e3f0f55..ad7dd68315bbdee47dd7f0c37e0530aa77733561 100644 (file)
@@ -23,21 +23,22 @@ while (<STDIN>) {
   }
   if ($map and /{\s*"(.+)"\s*,\s*(\w+)\s*,\s*(?:"([^"]+)"|(\w+))\s*}/) {
     my ($function, $op, $binding) = ($1, $2, $3 || $4);
   }
   if ($map and /{\s*"(.+)"\s*,\s*(\w+)\s*,\s*(?:"([^"]+)"|(\w+))\s*}/) {
     my ($function, $op, $binding) = ($1, $2, $3 || $4);
-    $binding =~ s/ /Space/;
-    $binding =~ s/^\\033/ESC /;
-    $binding =~ s/^\\010/Backspace/;
-    $binding =~ s/^\\(0\d+)$/'^'.chr(64+oct($1))/e;
-    $binding =~ s/^\\(0\d+)(.)/'^'.chr(64+oct($1)) ." $2"/e;
-    $binding =~ s/<(.+)>/$1/;
     $binding =~ s/&/&amp;/;
     $binding =~ s/&/&amp;/;
+    # for <key>, try CamelCasing into <Key>
+    $binding =~ s/<(.)(.+)>/&lt;\U$1\E$2&gt;/;
     $binding =~ s/</&lt;/;
     $binding =~ s/>/&gt;/;
     $binding =~ s/</&lt;/;
     $binding =~ s/>/&gt;/;
-    $binding =~ s/\\t/TAB/;
-    $binding =~ s/M_ENTER_S/RET/;
-    $binding =~ s/NULL/not bound/;
+    $binding =~ s/ /&lt;Space&gt;/;
+    $binding =~ s/^\\033/Esc /;
+    $binding =~ s/^\\010/&lt;Backspace&gt;/;
+    $binding =~ s/^\\(0\d+)$/'^'.chr(64+oct($1))/e;
+    $binding =~ s/^\\(0\d+)(.)/'^'.chr(64+oct($1)) ." $2"/e;
+    $binding =~ s/\\t/&lt;Tab&gt;/;
+    $binding =~ s/M_ENTER_S/&lt;Return&gt;/;
+    $binding =~ s/NULL//;
     die "unknown key $binding" if $binding =~ /\\[^\\]|<|>/;
     die "unknown OP $op" unless $OPS{$op};
     die "unknown key $binding" if $binding =~ /\\[^\\]|<|>/;
     die "unknown OP $op" unless $OPS{$op};
-    $MAP{$map} .= "<row><entry>$function</entry><entry>$binding</entry><entry>$OPS{$op}</entry></row>\n";
+    $MAP{$map} .= "<row><entry><literal>&lt;$function&gt;</literal></entry><entry>$binding</entry><entry>$OPS{$op}</entry></row>\n";
   }
   if ($map and /^}/) {
     undef $map;
   }
   if ($map and /^}/) {
     undef $map;
@@ -48,18 +49,21 @@ open XML, $xml or die "$xml: $!";
 while (<XML>) {
   if (/__print_map\((.*)\)/) {
     my $map = $1;
 while (<XML>) {
   if (/__print_map\((.*)\)/) {
     my $map = $1;
+    my $maptitle = $1;
+    $maptitle =~ s/^(.)/\U$1\E/;
     unless ($MAP{$map}) {
       warn "map $map undefined";
       next;
     }
     unless ($MAP{$map}) {
       warn "map $map undefined";
       next;
     }
+    my $title = $map;
+    $title =~ s/(.)(.+)/\U$1\E$2/;
     print <<EOT;
     print <<EOT;
-<sect2 id="${map}_map">
-<title>$map</title>
+<sect2 id="${map}-map">
+<title>$maptitle Menu</title>
 $DOC{$map}
 $DOC{$map}
-<para>
 
 
-<table id="${map}_table">
-<title>Default $map function bindings</title>
+<table id="tab-${map}-bindings">
+<title>Default $title Menu Bindings</title>
 <tgroup cols="3">
 <thead>
 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row>
 <tgroup cols="3">
 <thead>
 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row>
@@ -70,12 +74,10 @@ $MAP{$map}
 </tgroup>
 </table>
 
 </tgroup>
 </table>
 
-</para>
-
 </sect2>
 
 EOT
 </sect2>
 
 EOT
-    delete $MAP{$1};
+    delete $MAP{$map};
   } else {
     print;
   }
   } else {
     print;
   }