keys: move key definitions into translation includes
[sheet.git] / readline.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'readline cheat sheet',
5         version => '1.1',
6         description => [
7                 "Reference sheet of default key bindings for GNU readline,",
8                 "used for line-editing in most Unix software, notably Emacs and Bash.",
9         ],
10         keywords => [qw'
11                 readline gnu bash emacs sheet cheat reference overview keyboard editing curses
12         '],
13         stylesheet => [qw( light dark circus mono red )],
14         keys => 1,
15 });
16
17 :>
18 <h1>readline cheat sheet</h1>
19
20 <h2>default emacs mode</h2>
21
22 <:
23 use Shiar_Sheet::Keyboard 2;
24 my $info = do 'readline.eng.inc.pl' or die $@;
25 my $keys = Shiar_Sheet::Keyboard->new($info);
26 $keys->map($get{map}) or undef $get{map};
27 $keys->print_rows($get{rows} || '^x=213', [4,3,2]);
28 :>
29
30 <hr>
31
32 <div class="help">
33         <div class="left">
34 <: $keys->print_legend('legend-types', ['g1', 'g2', 'g4', 'g6' .. 'g9']) :>
35         </div>
36
37         <div class="right">
38 <: $keys->print_legend('legend-options', [qw( arg new ext )]) :>
39
40                 <ul class="legend legend-set">
41                 <li>keyboard <strong>map</strong> is
42                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
43                 <li><strong>keys</strong> are
44                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
45                                 !exists $get{keys} && ' by default' :>
46                 <li>default <strong>style</strong> is
47                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
48                 </ul>
49         </div>
50 </div>
51