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>
27 <p style="font-size:72%">Unofficial <span class="Xz">proposals</span>
28 are available as <a href="/digraphs.vim">ex commands</a>.</p>
31 my $di = do 'digraphs.inc.pl';
42 [qw{! " % ' ( ) * + , - . /}],
43 ['0'..'9'], [qw{: ; < = > ?}],
44 ['A'..'M'], ['N'..'Z'],
45 ['a'..'m'], ['n'..'z'],
47 my @chars2 = (['_'], @chars); # trailing character (extended set)
50 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
51 print "</colgroup><col>\n";
52 for my $section (qw{thead tfoot}) {
53 print "<$section><tr><th> ";
54 print '<th>', quote($_) for map {@$_} @chars2;
57 for my $c1group (@chars) {
59 for my $c1 (@$c1group) {
60 print '<tr><th>', quote($c1);
61 for my $c2 (map {@$_} @chars2) {
63 if (not defined $di->{$mnem}) {
67 if (ref $di->{$mnem} ne 'ARRAY') {
68 printf '<td class="X Xr" title="%s">', quote($mnem);
71 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
73 my $glyph = $string || chr $codepoint;
74 utf8::upgrade($glyph); # prevent latin1 output
75 my $desc = $mnem . ($name && " ($name)");
76 my @class = ('X', grep {$_} $prop, $script);
78 $glyph = quote($glyph);
79 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
81 printf "\n".'<td class="%s" title="%s">%s',
82 join(' ', @class), quote($desc), $glyph;
84 print "\n<th>", quote($c1), "\n";
91 <td class="X Cc">control
92 <td class="X Zs"><span>spacing</span>
93 <td class="X Mn">modifier
94 <td class="X Sk">spacing modifier
95 <td class="X Pf">quote
96 <td class="X Po">punctuation
97 <td class="X So">symbol
99 <td class="X Sc">currency
100 <td class="X No">numeric
101 <td class="X Greek">greek
102 <td class="X Cyrillic">cyrillic
103 <td class="X Latin">latin
104 <td class="X Hebrew">hebrew
105 <td class="X Arabic">arabic
106 <td class="X Hangul">korean
107 <td class="X Hiragana">japanese
108 <td class="X Bopomofo">chinese
112 <td class="X">unicode
113 <td class="X Xl">latin1
114 <td class="X Xa">ascii
115 <td class="X Xz">proposed
120 <a href="http://vi.shiar.net/digraphs">vi.<strong>shiar.net</strong>/digraphs</a>
121 <a href="git://dev.shiar.net/vi-cheat"><:= "v$VERSION" :></a>
123 <a title="Licensed under the GNU Affero General Public License, version 3"
124 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
126 use Time::Format qw(time_format);
127 print time_format('yyyy-mm-dd', (stat 'digraphs.inc.pl')[9]);