5 no warnings 'qw'; # to quote or not to quote, that is the question
6 use open IO => ':utf8';
10 $header{content_type} = 'text/html; charset=utf-8';
12 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
13 "http://www.w3.org/TR/html4/loose.dtd">
17 <title>digraph cheat sheet</title>
18 <meta http-equiv="content-type" content="utf-8">
19 <link rel="stylesheet" type="text/css" media="all" href="digraphs.css">
23 <h1>RFC-1345 Digraphs</h1>
25 <p>i^k in <a href="/">Vim</a>.
26 Also see <a href="/unicode">common digraphs</a>.</p>
28 <p style="font-size:72%">Unofficial <span class="Xz">proposals</span>
29 are available as <a href="/digraphs.vim">ex commands</a>.</p>
32 my $di = do 'digraphs.inc.pl';
43 [qw{! " % ' ( ) * + , - . /}],
44 ['0'..'9'], [qw{: ; < = > ?}],
45 ['A'..'M'], ['N'..'Z'],
46 ['a'..'m'], ['n'..'z'],
48 my @chars2 = (['_'], @chars); # trailing character (extended set)
50 print '<table class="glyphs dimap"><col>';
51 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
52 print "</colgroup><col>\n";
53 for my $section (qw{thead tfoot}) {
54 print "<$section><tr><th>↳";
55 print '<th>', quote($_) for map {@$_} @chars2;
58 for my $c1group (@chars) {
60 for my $c1 (@$c1group) {
61 print '<tr><th>', quote($c1);
62 for my $c2 (map {@$_} @chars2) {
64 if (not defined $di->{$mnem}) {
68 if (ref $di->{$mnem} ne 'ARRAY') {
69 printf '<td class="X Xr" title="%s">', quote($mnem);
72 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
74 my $glyph = $string || chr $codepoint;
75 utf8::upgrade($glyph); # prevent latin1 output
76 my $desc = $mnem . ($name && " ($name)");
77 my @class = ('X', grep {$_} $prop, $script);
79 $glyph = quote($glyph);
80 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
82 printf "\n".'<td class="%s" title="%s">%s',
83 join(' ', @class), quote($desc), $glyph;
85 print "\n<th>", quote($c1), "\n";
91 <table class="glyphs"><tr>
92 <td class="X Cc">control
93 <td class="X Zs"><span>spacing</span>
94 <td class="X Mn">modifier
95 <td class="X Sk">spacing modifier
96 <td class="X Pf">quote
97 <td class="X Po">punctuation
98 <td class="X So">symbol
100 <td class="X Sc">currency
101 <td class="X No">numeric
102 <td class="X Greek">greek
103 <td class="X Cyrillic">cyrillic
104 <td class="X Latin">latin
105 <td class="X Hebrew">hebrew
106 <td class="X Arabic">arabic
107 <td class="X Hangul">korean
108 <td class="X Hiragana">japanese
109 <td class="X Bopomofo">chinese
112 <table class="glyphs"><tr>
113 <td class="X">unicode
114 <td class="X Xl">latin1
115 <td class="X Xa">ascii
116 <td class="X Xz">proposed
121 <a href="http://vi.shiar.net/digraphs">vi.<strong>shiar.net</strong>/digraphs</a>
122 <a href="git://dev.shiar.net/vi-cheat"><:= "v$VERSION" :></a>
124 <a title="Licensed under the GNU Affero General Public License, version 3"
125 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
127 use Time::Format qw(time_format);
128 print time_format('yyyy-mm-dd', (stat 'digraphs.inc.pl')[9]);