base: reorganise code
[sheet.git] / readline.plp
index 0488d87ecd561ad427fdd03599d7b82034afd3d8..9c7c027a8c68754fa886d2a929d5d399b9a47993 100644 (file)
@@ -2,7 +2,7 @@
 
 Html({
        title => 'readline cheat sheet',
-       version => 'v1.0',
+       version => 'v1.1',
        description => [
                "Reference sheet of default key bindings for GNU readline,",
                "used for line-editing in most Unix software, notably Emacs and Bash.",
@@ -20,53 +20,24 @@ Html({
 
 <h2>default emacs mode</h2>
 
-<ul id="rows">
-
-<li class="row">
-       <ul class="keys omni">
-       <li class="me" onclick="setmode()"><b>Esc</b> +
-       </ul>
-</li>
-
 <:
-use Shiar_Sheet::Keyboard;
-my $keys = Shiar_Sheet::Keyboard->new({do 'readline.inc.pl'});
+use Shiar_Sheet::Keyboard 2;
+my $info = do 'readline.eng.inc.pl' or die $@;
+$info->{def} = do 'readline.inc.pl';
+my $keys = Shiar_Sheet::Keyboard->new($info);
 $keys->map($get{map}) or undef $get{map};
 $keys->print_rows($get{rows} || '^x=213', [4,3,2]);
 :>
-</ul>
 
 <hr>
 
 <div class="help">
        <div class="left">
-               <dl class="legend legend-types">
-               <dt class="ci">info
-                       <dd>Info command: shows/does something without altering anything.
-               <dt class="pm">motion
-                       <dd>Move the cursor.
-               <dt class="co">history
-                       <dd>Replace contents involving kill ring, undo, or command history.
-               <dt class="mi">change
-                       <dd>Alter current text (filtering or completion).
-               <dt class="mo">delete
-                       <dd>Remove text.
-               <dt class="mv">misc
-                       <dd>Miscellaneous commands.
-               <dt class="me">mode
-                       <dd>Additional key functionality (click to view).
-               </dl>
+<: $keys->print_legend('legend-types', [qw( ci pm co mi mo mv me )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need a char argument afterwards.
-               <dt class="new">&gt;v2.0
-                       <dd>Unavailable before readline version 2.1 (1997).
-               <dt class="ext">bash
-                       <dd>Default assignment in Bash shells, but not common readline.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg new ext )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is