]> granicus.if.org Git - mutt/commitdiff
Improve gen-map-doc work on multi-word maps.
authorKevin McCarthy <kevin@8t8.us>
Mon, 29 Jul 2019 02:23:12 +0000 (19:23 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sat, 3 Aug 2019 21:08:09 +0000 (14:08 -0700)
doc/gen-map-doc

index e2fadaca23e0a4860ef84c26acb991e1f018ff79..775ce470290d24b33bc9a222395d017f43f128a0 100644 (file)
@@ -49,21 +49,21 @@ open XML, $xml or die "$xml: $!";
 while (<XML>) {
   if (/__print_map\((.*)\)/) {
     my $map = $1;
+    my $mapid = $1;
     my $maptitle = $1;
-    $maptitle =~ s/^(.)/\U$1\E/;
+    $mapid =~ s/\s+/-/g;
+    $maptitle =~ s/\b(\w)/\u$1/g;
     unless ($MAP{$map}) {
       warn "map $map undefined";
       next;
     }
-    my $title = $map;
-    $title =~ s/(.)(.+)/\U$1\E$2/;
     print <<EOT;
-<sect2 id="${map}-map">
+<sect2 id="${mapid}-map">
 <title>$maptitle Menu</title>
 $DOC{$map}
 
-<table id="tab-${map}-bindings">
-<title>Default $title Menu Bindings</title>
+<table id="tab-${mapid}-bindings">
+<title>Default $maptitle Menu Bindings</title>
 <tgroup cols="3">
 <thead>
 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row>