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