keys: replace omni-present escape keys
[sheet.git] / vimperator.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'vimperator cheat sheet',
5         version => 'v1.2',
6         description => [
7                 "Interactive cheat sheet for the Vimperator Firefox extension,",
8                 "describing the function of each key.",
9         ],
10         keywords => [qw'
11                 vimperator firefox vim iceweasel sheet cheat reference overview
12                 commands keyboard browser
13         '],
14         charset => $sign{charset},
15         stylesheet => [qw'light dark circus mono red terse'],
16         keys => 1,
17 });
18
19 :>
20 <h1>Vimperator cheat sheet</h1>
21
22 <h2>normal mode (default)</h2>
23
24 <ul id="rows">
25
26 <:
27 use Shiar_Sheet::Keyboard 2;
28 my $info = do 'vimperator.eng.inc.pl' or die $@;
29 $info->{def} = do 'vimperator.inc.pl';
30 $_->{"\e"} = ['mv mode', "normal mode"] for values %{ $info->{def} };
31 delete $info->{def}->{''}->{"\e"};
32 my $keys = Shiar_Sheet::Keyboard->new($info);
33 $keys->map($get{map}) or undef $get{map};
34 $keys->print_rows($get{rows});
35 :>
36 </ul>
37
38 <hr>
39
40 <div class="help">
41         <div class="left">
42                 <dl class="legend legend-types">
43                 <dt class="ci">info
44                         <dd>Displays something without any permanent consequences.
45                 <dt class="pm">motion
46                         <dd>Move cursor, scroll window, focus buffer element.
47                 <dt class="po">tab
48                         <dd>Tab or window navigation/selection.
49                 <dt class="co">buffer
50                         <dd>Page interaction.
51                 <dt class="cp">open
52                         <dd>Browse to a location in the current tab.
53                 <dt class="mi">tab open
54                         <dd>Browse somewhere in a new tab.
55                 <dt class="mo">browser
56                         <dd>Other browser action.
57                 <dt class="mv">mode
58                         <dd>Enter a different mode.
59                 <dt class="me">key cmd
60                         <dd>Additional key commands (click for overview).
61                 </dl>
62         </div>
63
64         <div class="right">
65                 <dl class="legend legend-options">
66                 <dt>key<:= $sign{arg} :>
67                         <dd>Commands with a dot need a char argument afterwards.
68                 <dt>key<:= $sign{args} :>
69                         <dd>Commands with two dots require variable arguments afterwards.
70                 </dl>
71
72                 <ul class="legend legend-set">
73                 <li>keyboard <strong>map</strong> is
74                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
75                 <li><strong>ascii</strong> mode is
76                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
77                                 $sign{-ascii} ? 'on' : 'off' :></em>
78                 <li><strong>keys</strong> are
79                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
80                                 !exists $get{keys} && ' by default' :>
81                 <li>default <strong>style</strong> is
82                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
83                 </ul>
84         </div>
85 </div>
86