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">
20 <link rel="vcs" type="git" href="git://dev.shiar.nl/sheet">
24 <h1>RFC-1345 Digraphs</h1>
26 <p>i^k in <a href="/">Vim</a>.
27 Also see <a href="/unicode">common digraphs</a>.</p>
29 <p style="font-size:72%">Unofficial <span class="Xz">proposals</span>
30 are available as <a href="/digraphs.vim">ex commands</a>.</p>
33 my $di = do 'digraphs.inc.pl';
44 [qw{! " % ' ( ) * + , - . /}],
45 ['0'..'9'], [qw{: ; < = > ?}],
46 ['A'..'M'], ['N'..'Z'],
47 ['a'..'m'], ['n'..'z'],
49 my @chars2 = (['_'], @chars); # trailing character (extended set)
51 print '<table class="glyphs dimap"><col>';
52 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
53 print "</colgroup><col>\n";
54 for my $section (qw{thead tfoot}) {
55 print "<$section><tr><th>↳";
56 print '<th>', quote($_) for map {@$_} @chars2;
59 for my $c1group (@chars) {
61 for my $c1 (@$c1group) {
62 print '<tr><th>', quote($c1);
63 for my $c2 (map {@$_} @chars2) {
65 if (not defined $di->{$mnem}) {
69 if (ref $di->{$mnem} ne 'ARRAY') {
70 printf '<td class="X Xr" title="%s">', quote($mnem);
73 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
75 my $glyph = $string || chr $codepoint;
76 utf8::upgrade($glyph); # prevent latin1 output
77 my $desc = $mnem . ($name && " ($name)");
78 my @class = ('X', grep {$_} $prop, $script);
80 $glyph = quote($glyph);
81 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
83 printf "\n".'<td class="%s" title="%s">%s',
84 join(' ', @class), quote($desc), $glyph;
86 print "\n<th>", quote($c1), "\n";
92 <table class="glyphs"><tr>
93 <td class="X Cc">control
94 <td class="X Zs"><span>spacing</span>
95 <td class="X Mn">modifier
96 <td class="X Sk">spacing modifier
97 <td class="X Pf">quote
98 <td class="X Po">punctuation
99 <td class="X So">symbol
100 <td class="X Sm">math
101 <td class="X Sc">currency
102 <td class="X No">numeric
103 <td class="X Greek">greek
104 <td class="X Cyrillic">cyrillic
105 <td class="X Latin">latin
106 <td class="X Hebrew">hebrew
107 <td class="X Arabic">arabic
108 <td class="X Hangul">korean
109 <td class="X Hiragana">japanese
110 <td class="X Bopomofo">chinese
113 <table class="glyphs"><tr>
114 <td class="X">unicode
115 <td class="X Xl">latin1
116 <td class="X Xa">ascii
117 <td class="X Xz">proposed
122 <a href="http://sheet.shiar.nl/digraphs">sheet.shiar.nl<strong>/digraphs</strong></a>
123 <a href="git://dev.shiar.nl/sheet"><:= "v$VERSION" :></a>
125 <a title="Licensed under the GNU Affero General Public License, version 3"
126 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
128 use Time::Format qw(time_format);
129 print time_format('yyyy-mm-dd', (stat 'digraphs.inc.pl')[9]);