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>
25 my $di = do 'digraphs.inc.pl';
36 [qw{! " % ' ( ) * + , - . /}],
37 ['0'..'9'], [qw{: ; < = > ?}],
38 ['A'..'M'], ['N'..'Z'],
39 ['a'..'m'], ['n'..'z'],
41 my @chars2 = (@chars, ['_']); # trailing character (extended set)
44 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
45 print "</colgroup><col>\n";
46 for my $section (qw{thead tfoot}) {
47 print "<$section><tr><th> ";
48 print '<th>', quote($_) for map {@$_} @chars2;
51 for my $c1group (@chars) {
53 for my $c1 (@$c1group) {
54 print '<tr><th>', quote($c1);
55 for my $c2 (map {@$_} @chars2) {
57 if (not defined $di->{$mnem}) {
61 if (ref $di->{$mnem} ne 'ARRAY') {
62 printf '<td class="X Xr" title="%s">', quote($mnem);
65 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
67 my $glyph = $string || chr $codepoint;
68 utf8::upgrade($glyph); # prevent latin1 output
69 my $desc = $mnem . ($name && " ($name)");
70 my @class = ('X', grep {$_} $prop, $script);
72 $glyph = quote($glyph);
73 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
75 printf "\n".'<td class="%s" title="%s">%s',
76 join(' ', @class), quote($desc), $glyph;
78 print "\n<th>", quote($c1), "\n";
85 <td class="X Cc">control
86 <td class="X Zs"><span>spacing</span>
87 <td class="X Mn">modifier
88 <td class="X Sk">spacing modifier
89 <td class="X Pf">quote
90 <td class="X Po">punctuation
91 <td class="X So">symbol
93 <td class="X Sc">currency
94 <td class="X No">numeric
95 <td class="X Greek">greek
96 <td class="X Cyrillic">cyrillic
97 <td class="X Latin">latin
98 <td class="X Hebrew">hebrew
99 <td class="X Arabic">arabic
100 <td class="X Hangul">korean
101 <td class="X Hiragana">japanese
102 <td class="X Bopomofo">chinese
106 <td class="X">unicode
107 <td class="X Xl">latin1
108 <td class="X Xa">ascii
109 <td class="X Co">private
110 <td class="X Xz">proposed
115 <a href="http://vi.shiar.net/digraphs">vi.<strong>shiar.net</strong>/digraphs</a>
116 <a href="git://dev.shiar.net/vi-cheat"><:= "v$VERSION" :></a>
118 <a title="Licensed under the GNU Affero General Public License, version 3"
119 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
121 use Time::Format qw(time_format);
122 print time_format('yyyy-mm-dd', (stat 'digraphs.inc.pl')[9]);