]> granicus.if.org Git - neomutt/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)
committerRichard Russon <rich@flatcap.org>
Mon, 19 Aug 2019 23:14:27 +0000 (00:14 +0100)
Co-authored-by: Richard Russon <rich@flatcap.org>
doc/gen-map-doc

index 79ff237fa84acf50cfc9de7ee9c21c3c5d4fcfcd..4f1733dc6ed8b119e21731b904dc9d9702500859 100644 (file)
@@ -56,21 +56,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>