5 use open IO => ':utf8';
9 $header{content_type} = 'text/html; charset=utf-8';
11 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
12 "http://www.w3.org/TR/html4/loose.dtd">
16 <title>digraph cheat sheet</title>
17 <meta http-equiv="content-type" content="utf-8">
18 <link rel="stylesheet" type="text/css" media="all" href="digraphs.css">
22 <h1>RFC-1345 Digraphs</h1>
24 <p>i^k in <a href="/">Vim</a>.
25 Also see <a href="/unicode">common digraphs</a>.</p>
28 my $di = do 'digraphs.inc.pl';
39 [qw{! " % ' ( ) * + , - . /}],
40 ['0'..'9'], [qw{: ; < = > ?}],
41 ['A'..'M'], ['N'..'Z'],
42 ['a'..'m'], ['n'..'z'],
44 my @chars2 = (['_'], @chars); # trailing character (extended set)
47 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
48 print "</colgroup><col>\n";
49 for my $section (qw{thead tfoot}) {
50 print "<$section><tr><th> ";
51 print '<th>', quote($_) for map {@$_} @chars2;
54 for my $c1group (@chars) {
56 for my $c1 (@$c1group) {
57 print '<tr><th>', quote($c1);
58 for my $c2 (map {@$_} @chars2) {
60 if (not defined $di->{$mnem}) {
64 if (ref $di->{$mnem} ne 'ARRAY') {
65 printf '<td class="X Xr" title="%s">', quote($mnem);
68 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
70 my $glyph = $string || chr $codepoint;
71 utf8::upgrade($glyph); # prevent latin1 output
72 my $desc = $mnem . ($name && " ($name)");
73 my @class = ('X', grep {$_} $prop, $script);
75 $glyph = quote($glyph);
76 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
78 printf "\n".'<td class="%s" title="%s">%s',
79 join(' ', @class), quote($desc), $glyph;
81 print "\n<th>", quote($c1), "\n";
88 <td class="X Cc">control
89 <td class="X Zs"><span>spacing</span>
90 <td class="X Mn">modifier
91 <td class="X Sk">spacing modifier
92 <td class="X Pf">quote
93 <td class="X Po">punctuation
94 <td class="X So">symbol
96 <td class="X Sc">currency
97 <td class="X No">numeric
98 <td class="X Greek">greek
99 <td class="X Cyrillic">cyrillic
100 <td class="X Latin">latin
101 <td class="X Hebrew">hebrew
102 <td class="X Arabic">arabic
103 <td class="X Hangul">korean
104 <td class="X Hiragana">japanese
105 <td class="X Bopomofo">chinese
109 <td class="X">unicode
110 <td class="X Xl">latin1
111 <td class="X Xa">ascii
112 <td class="X Xz">proposed
117 <a href="http://vi.shiar.net/digraphs">vi.<strong>shiar.net</strong>/digraphs</a>
118 <a href="git://dev.shiar.net/vi-cheat"><:= "v$VERSION" :></a>
120 <a title="Licensed under the GNU Affero General Public License, version 3"
121 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
123 use Time::Format qw(time_format);
124 print time_format('yyyy-mm-dd', (stat 'digraphs.inc.pl')[9]);