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="u-prop ex">proposals</span>
23 are available as <a href="/digraphs.vim">ex commands</a>.</p>
26 my $di = do 'digraphs.inc.pl'
27 or die "Error loading digraphs data: ", $@ // $!;
30 [qw{! " % ' ( ) * + , - . /}],
31 ['0'..'9'], [qw{: ; < = > ?}],
32 ['A'..'M'], ['N'..'Z'],
33 ['a'..'m'], ['n'..'z'],
35 my @chars2 = (['_'], @chars); # trailing character (extended set)
36 my @columns = !exists $get{split} ? \@chars2 :
37 ([@chars2[0, 1, 3, 4, 6]], [@chars2[2, 5, 7]]);
39 for my $colchars (@columns) {
40 print '<table class="glyphs dimap"><col>';
41 print qq'<colgroup span="$_">' for map {scalar @$_} @{$colchars};
42 print "</colgroup><col>\n";
43 for my $section (qw{thead tfoot}) {
44 print "<$section><tr><th>↳";
45 print '<th>', EscapeHTML($_) for map {@$_} @{$colchars};
48 for my $c1group (@chars) {
50 for my $c1 (@$c1group) {
51 print '<tr><th>', EscapeHTML($c1);
52 for my $c2 (map {@$_} @$colchars) {
54 if (not defined $di->{$mnem}) {
58 if (ref $di->{$mnem} ne 'ARRAY') {
59 printf '<td class="X Xr" title="%s">', EscapeHTML($mnem);
62 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
64 my $glyph = $string || chr $codepoint;
65 utf8::upgrade($glyph); # prevent latin1 output
66 my $desc = $mnem . ($name && " ($name)");
67 my @class = ('X', grep {$_} $prop, $script);
69 $glyph = EscapeHTML($glyph);
70 $glyph = "<span>$glyph</span>" if $script =~ /\bZs\b/;
72 printf "\n".'<td class="%s" title="%s">%s',
73 join(' ', @class), EscapeHTML($desc), $glyph;
75 print "\n<th>", EscapeHTML($c1), "\n";
79 print '<hr>' if exists $get{split};
83 <table class="glyphs"><tr>
84 <td class="X Cc">control
85 <td class="X Zs"><span>space</span>
86 <td class="X Mn">combining
87 <td class="X Sk">spacing modifier
88 <td class="X Pf">quote
89 <td class="X Po">punctuation
90 <td class="X So">symbol
92 <td class="X Sc">currency
93 <td class="X No">numeric
94 <td class="X Greek">greek
95 <td class="X Cyrillic">cyrillic
96 <td class="X Latin">latin
97 <td class="X Hebrew">hebrew
98 <td class="X Arabic">arabic
99 <td class="X Hangul">korean
100 <td class="X Hiragana">japanese
101 <td class="X Bopomofo">chinese
104 <table class="glyphs"><tr>
105 <td class="X">unicode
106 <td class="X Xl">latin1
107 <td class="X Xa">ascii
108 <td class="X u-prop">vim extension
109 <td class="X u-prop ex">proposal
110 <td class="X ex">not in vim