browser: presentational update
[sheet.git] / vi.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'vi cheat sheet',
5         version => 'v1.3',
6         description => [
7                 "Interactive cheat sheet for vi text editors, notably Vim,",
8                 "describing each key in various modes.",
9         ],
10         keywords => [qw'
11                 vi vim nvi sheet cheat reference overview commands keyboard
12         '],
13         charset => $sign{charset},
14         stylesheet => [qw'light dark circus mono red terse'],
15         keys => 1,
16 });
17
18 :>
19 <h1>vi/vim cheat sheet</h1>
20
21 <h2>normal mode (default)</h2>
22
23 <ul id="rows">
24
25 <:
26 use Shiar_Sheet::Keyboard 2;
27 my $info = do 'vi.eng.inc.pl' or die $@;
28 $info->{def} = do 'vi.inc.pl';
29 my $keys = Shiar_Sheet::Keyboard->new($info);
30 $keys->map($get{map}) or undef $get{map};
31 $keys->print_rows($get{rows});
32 :>
33 </ul>
34
35 <hr>
36
37 <div class="help">
38         <div class="left">
39 <:
40                 $keys->print_legend('legend-types', [qw'ci pm po co mi mo mv me']);
41 :>
42         </div>
43
44         <div class="right">
45 <:
46                 $keys->print_legend('legend-options', [qw'arg motion', 'ext vim6', 'ext new vim7']);
47 :>
48
49                 <ul class="legend legend-set">
50                 <li>keyboard <strong>map</strong> is
51                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
52                 <li><strong>ascii</strong> mode is
53                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
54                                 $sign{-ascii} ? 'on' : 'off' :></em>
55                 <li><strong>keys</strong> are
56                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
57                                 !defined $showkeys && ' by default' :>
58                 <li>default <strong>style</strong> is
59                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
60                 </ul>
61         </div>
62 </div>
63