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';
29 [qw{! " % ' ( ) * + , - . /}],
30 ['0'..'9'], [qw{: ; < = > ?}],
31 ['A'..'M'], ['N'..'Z'],
32 ['a'..'m'], ['n'..'z'],
34 my @chars2 = (['_'], @chars); # trailing character (extended set)
35 my @columns = !exists $get{split} ? \@chars2 :
36 ([@chars2[0, 1, 3, 4, 6]], [@chars2[2, 5, 7]]);
38 for my $colchars (@columns) {
39 print '<table class="glyphs dimap"><col>';
40 print qq'<colgroup span="$_">' for map {scalar @$_} @{$colchars};
41 print "</colgroup><col>\n";
42 for my $section (qw{thead tfoot}) {
43 print "<$section><tr><th>↳";
44 print '<th>', EscapeHTML($_) for map {@$_} @{$colchars};
47 for my $c1group (@chars) {
49 for my $c1 (@$c1group) {
50 print '<tr><th>', EscapeHTML($c1);
51 for my $c2 (map {@$_} @$colchars) {
53 if (not defined $di->{$mnem}) {
57 if (ref $di->{$mnem} ne 'ARRAY') {
58 printf '<td class="X Xr" title="%s">', EscapeHTML($mnem);
61 my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
63 my $glyph = $string || chr $codepoint;
64 utf8::upgrade($glyph); # prevent latin1 output
65 my $desc = $mnem . ($name && " ($name)");
66 my @class = ('X', grep {$_} $prop, $script);
68 $glyph = EscapeHTML($glyph);
69 $glyph = "<span>$glyph</span>" if $script =~ /\bZs\b/;
71 printf "\n".'<td class="%s" title="%s">%s',
72 join(' ', @class), EscapeHTML($desc), $glyph;
74 print "\n<th>", EscapeHTML($c1), "\n";
78 print '<hr>' if exists $get{split};
82 <table class="glyphs"><tr>
83 <td class="X Cc">control
84 <td class="X Zs"><span>space</span>
85 <td class="X Mn">combining
86 <td class="X Sk">spacing modifier
87 <td class="X Pf">quote
88 <td class="X Po">punctuation
89 <td class="X So">symbol
91 <td class="X Sc">currency
92 <td class="X No">numeric
93 <td class="X Greek">greek
94 <td class="X Cyrillic">cyrillic
95 <td class="X Latin">latin
96 <td class="X Hebrew">hebrew
97 <td class="X Arabic">arabic
98 <td class="X Hangul">korean
99 <td class="X Hiragana">japanese
100 <td class="X Bopomofo">chinese
103 <table class="glyphs"><tr>
104 <td class="X">unicode
105 <td class="X Xl">latin1
106 <td class="X Xa">ascii
107 <td class="X u-prop">vim extension
108 <td class="X u-prop ex">proposal
109 <td class="X ex">not in vim