4 title => 'digraph cheat sheet',
7 "Complete table of digraph characters from RFC-1345.",
10 digraph compose character char glyph table unicode vim
12 stylesheet => [qw'light'],
13 data => [qw( digraphs.inc.pl )],
17 <h1>RFC-1345 Digraphs</h1>
19 <p>i^k in <a href="/vi">Vim</a>.
20 Also see <a href="/unicode">common digraphs</a>.</p>
22 <p class="aside">Unofficial <span class="Xz">proposals</span>
23 are available as <a href="/digraphs.vim">ex commands</a>.</p>
26 my $di = do 'digraphs.inc.pl';
29 [qw{! " % ' ( ) * + , - . /}],
30 ['0'..'9'], [qw{: ; < = > ?}],
31 ['A'..'M'], ['N'..'Z'],
32 ['a'..'m'], ['n'..'z'],
34 my @chars2 = (['_'], @chars); # trailing character (extended set)
36 print '<table class="glyphs dimap"><col>';
37 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
38 print "</colgroup><col>\n";
39 for my $section (qw{thead tfoot}) {
40 print "<$section><tr><th>↳";
41 print '<th>', EscapeHTML($_) for map {@$_} @chars2;
44 for my $c1group (@chars) {
46 for my $c1 (@$c1group) {
47 print '<tr><th>', EscapeHTML($c1);
48 for my $c2 (map {@$_} @chars2) {
50 if (not defined $di->{$mnem}) {
54 if (ref $di->{$mnem} ne 'ARRAY') {
55 printf '<td class="X Xr" title="%s">', EscapeHTML($mnem);
58 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
60 my $glyph = $string || chr $codepoint;
61 utf8::upgrade($glyph); # prevent latin1 output
62 my $desc = $mnem . ($name && " ($name)");
63 my @class = ('X', grep {$_} $prop, $script);
65 $glyph = EscapeHTML($glyph);
66 $glyph = "<span>$glyph</span>" if $prop =~ /\bZs\b/;
68 printf "\n".'<td class="%s" title="%s">%s',
69 join(' ', @class), EscapeHTML($desc), $glyph;
71 print "\n<th>", EscapeHTML($c1), "\n";
77 <table class="glyphs"><tr>
78 <td class="X Cc">control
79 <td class="X Zs"><span>spacing</span>
80 <td class="X Mn">modifier
81 <td class="X Sk">spacing modifier
82 <td class="X Pf">quote
83 <td class="X Po">punctuation
84 <td class="X So">symbol
86 <td class="X Sc">currency
87 <td class="X No">numeric
88 <td class="X Greek">greek
89 <td class="X Cyrillic">cyrillic
90 <td class="X Latin">latin
91 <td class="X Hebrew">hebrew
92 <td class="X Arabic">arabic
93 <td class="X Hangul">korean
94 <td class="X Hiragana">japanese
95 <td class="X Bopomofo">chinese
98 <table class="glyphs"><tr>
100 <td class="X Xl">latin1
101 <td class="X Xa">ascii
102 <td class="X Xz">proposed