minor code cosmetics (declare version first)
[sheet.git] / readline.plp
1 <(common.inc.plp)><:
2         our $VERSION = 'v1.0';
3
4         use Shiar_Sheet::KeySigns qw(%sign);  # dependant on $get{ascii}
5
6         $header{content_type} = "text/html; charset=$sign{charset}";
7
8 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
9  "http://www.w3.org/TR/html4/loose.dtd">
10 <html>
11
12 <head>
13 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
14 <title>readline cheat sheet</title>
15 <:= stylesheet(qw'light dark circus mono red terse') :>
16 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
17 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
18         our $showkeys = exists $get{keys} && $get{keys} ne '0';
19         print "\n".'<style type="text/css"> .no {visibility:hidden} </style>'
20                 unless $showkeys;
21         print "\n".'<style type="text/css"> .no, .alias {opacity:.5} </style>'
22                 if $showkeys and $get{keys} eq 'ghost';
23 :>
24 <script type="text/javascript" src="/keys.js"></script>
25
26 <body id="readline">
27
28 <h1>readline cheat sheet</h1>
29
30 <h2>default emacs mode</h2>
31
32 <ul id="rows">
33
34 <li class="row">
35         <ul class="keys omni">
36         <li class="me" onclick="setmode()"><b>Esc</b> +
37         </ul>
38 </li>
39
40 <:
41 use Shiar_Sheet::Keyboard;
42 my $keys = Shiar_Sheet::Keyboard->new({do 'readline.inc.pl'});
43 $keys->map($get{map}) or undef $get{map};
44 $keys->print_rows($get{rows} || '^x=213', [4,3,2]);
45 :>
46 </ul>
47
48 <hr>
49
50 <div class="help">
51         <div class="left">
52                 <dl class="legend legend-types">
53                 <dt class="ci">info
54                         <dd>Info command: shows/does something without altering anything.
55                 <dt class="pm">motion
56                         <dd>Move the cursor.
57                 <dt class="co">history
58                         <dd>Replace contents involving kill ring, undo, or command history.
59                 <dt class="mi">change
60                         <dd>Alter current text (filtering or completion).
61                 <dt class="mo">delete
62                         <dd>Remove text.
63                 <dt class="mv">misc
64                         <dd>Miscellaneous commands.
65                 <dt class="me">mode
66                         <dd>Additional key functionality (click to view).
67                 </dl>
68         </div>
69
70         <div class="right">
71                 <dl class="legend legend-options">
72                 <dt>key<:= $sign{arg} :>
73                         <dd>Commands with a dot need a char argument afterwards.
74                 <dt class="new">&gt;v2.0
75                         <dd>Unavailable before readline version 2.1 (1997).
76                 <dt class="ext">bash
77                         <dd>Default assignment in Bash shells, but not common readline.
78                 </dl>
79
80                 <ul class="legend legend-set">
81                 <li>keyboard <strong>map</strong> is
82                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
83                 <li><strong>ascii</strong> mode is
84                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
85                                 $sign{-ascii} ? 'on' : 'off' :></em>
86                 <li><strong>keys</strong> are
87                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
88                                 !exists $get{keys} && ' by default' :>
89                 <li>default <strong>style</strong> is
90                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
91                 </ul>
92         </div>
93 </div>
94
95 <p class="footer">
96         <a href="/" rel="home">sheet.shiar.nl</a>/readline.<a href="/source/readline.plp"
97          rel="code" title="Written in Perl">plp</a>
98         <a href="http://git.shiar.nl/sheet.git/history/HEAD:/readline.plp"
99          rel="vcs-git" title="Git repository"><:= $VERSION :></a>
100         created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
101         <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
102          title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
103 </p>
104
105 </html>