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="/base.css"><:
20 my %styles = map {$_ => $_} qw(dark circus mono red terse);
21 our $style = exists $get{style} && $styles{$get{style}} || 'light';
22 printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
23 $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_
29 <h1>RFC-1345 Digraphs</h1>
31 <p>i^k in <a href="/">Vim</a>.
32 Also see <a href="/unicode">common digraphs</a>.</p>
34 <p class="aside">Unofficial <span class="Xz">proposals</span>
35 are available as <a href="/digraphs.vim">ex commands</a>.</p>
38 my $di = do 'digraphs.inc.pl';
49 [qw{! " % ' ( ) * + , - . /}],
50 ['0'..'9'], [qw{: ; < = > ?}],
51 ['A'..'M'], ['N'..'Z'],
52 ['a'..'m'], ['n'..'z'],
54 my @chars2 = (['_'], @chars); # trailing character (extended set)
56 print '<table class="glyphs dimap"><col>';
57 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
58 print "</colgroup><col>\n";
59 for my $section (qw{thead tfoot}) {
60 print "<$section><tr><th>↳";
61 print '<th>', quote($_) for map {@$_} @chars2;
64 for my $c1group (@chars) {
66 for my $c1 (@$c1group) {
67 print '<tr><th>', quote($c1);
68 for my $c2 (map {@$_} @chars2) {
70 if (not defined $di->{$mnem}) {
74 if (ref $di->{$mnem} ne 'ARRAY') {
75 printf '<td class="X Xr" title="%s">', quote($mnem);
78 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
80 my $glyph = $string || chr $codepoint;
81 utf8::upgrade($glyph); # prevent latin1 output
82 my $desc = $mnem . ($name && " ($name)");
83 my @class = ('X', grep {$_} $prop, $script);
85 $glyph = quote($glyph);
86 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
88 printf "\n".'<td class="%s" title="%s">%s',
89 join(' ', @class), quote($desc), $glyph;
91 print "\n<th>", quote($c1), "\n";
97 <table class="glyphs"><tr>
98 <td class="X Cc">control
99 <td class="X Zs"><span>spacing</span>
100 <td class="X Mn">modifier
101 <td class="X Sk">spacing modifier
102 <td class="X Pf">quote
103 <td class="X Po">punctuation
104 <td class="X So">symbol
105 <td class="X Sm">math
106 <td class="X Sc">currency
107 <td class="X No">numeric
108 <td class="X Greek">greek
109 <td class="X Cyrillic">cyrillic
110 <td class="X Latin">latin
111 <td class="X Hebrew">hebrew
112 <td class="X Arabic">arabic
113 <td class="X Hangul">korean
114 <td class="X Hiragana">japanese
115 <td class="X Bopomofo">chinese
118 <table class="glyphs"><tr>
119 <td class="X">unicode
120 <td class="X Xl">latin1
121 <td class="X Xa">ascii
122 <td class="X Xz">proposed
127 <a href="/" rel="home">sheet.shiar.nl</a>/digraphs
128 <a href="git://git.shiar.nl/sheet" rel="vcs-git" title="Git repository"><:= $VERSION :></a>
129 created by <a href="http://shiar.nl/" rel="author">Shiar</a> •
130 <a title="Licensed under the GNU Affero General Public License, version 3" rel="copyright"
131 href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a>