digraphs: more memorable proposal for bullets
[sheet.git] / digraphs.plp
1 <(common.inc.plp)><:
2         our $VERSION = 'v1.0';
3
4 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
5  "http://www.w3.org/TR/html4/loose.dtd">
6 <html lang="en">
7
8 <head>
9 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
10 <title>digraph cheat sheet</title>
11 <meta name="description" content="Complete table of digraph characters from RFC-1345.">
12 <meta name="keywords" content="digraph, compose, character, char, glyph, table, unicode, vim">
13 <:= stylesheet(qw'light') :>
14 <link rel="icon" type="image/png" href="/clip.png">
15 </head>
16
17 <body id="digraphs">
18 <h1>RFC-1345 Digraphs</h1>
19
20 <p>i^k in <a href="/">Vim</a>.
21 Also see <a href="/unicode">common digraphs</a>.</p>
22
23 <p class="aside">Unofficial <span class="Xz">proposals</span>
24 are available as <a href="/digraphs.vim">ex commands</a>.</p>
25
26 <:
27 my $di = do 'digraphs.inc.pl';
28
29 my @chars = (
30         [qw{! " % ' ( ) * + , - . /}],
31         ['0'..'9'], [qw{: ; < = > ?}],
32         ['A'..'M'], ['N'..'Z'],
33         ['a'..'m'], ['n'..'z'],
34 );
35 my @chars2 = (['_'], @chars);  # trailing character (extended set)
36
37 print '<table class="glyphs dimap"><col>';
38 print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
39 print "</colgroup><col>\n";
40 for my $section (qw{thead tfoot}) {
41         print "<$section><tr><th>↳";
42         print '<th>', EscapeHTML($_) for map {@$_} @chars2;
43         print "<th>&nbsp;\n";
44 }
45 for my $c1group (@chars) {
46         print '<tbody>';
47         for my $c1 (@$c1group) {
48                 print '<tr><th>', EscapeHTML($c1);
49                 for my $c2 (map {@$_} @chars2) {
50                         my $mnem = $c1 . $c2;
51                         if (not defined $di->{$mnem}) {
52                                 print '<td>';
53                                 next;
54                         }
55                         if (ref $di->{$mnem} ne 'ARRAY') {
56                                 printf '<td class="X Xr" title="%s">', EscapeHTML($mnem);
57                                 next;
58                         }
59                         my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
60
61                         my $glyph = $string || chr $codepoint;
62                         utf8::upgrade($glyph);  # prevent latin1 output
63                         my $desc = $mnem . ($name && " ($name)");
64                         my @class = ('X', grep {$_} $prop, $script);
65
66                         $glyph = EscapeHTML($glyph);
67                         $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
68
69                         printf "\n".'<td class="%s" title="%s">%s',
70                                 join(' ', @class), EscapeHTML($desc), $glyph;
71                 }
72                 print "\n<th>", EscapeHTML($c1), "\n";
73         }
74 }
75 print "</table>\n";
76 :>
77 <div class="legend">
78         <table class="glyphs"><tr>
79         <td class="X Cc">control
80         <td class="X Zs"><span>spacing</span>
81         <td class="X Mn">modifier
82         <td class="X Sk">spacing modifier
83         <td class="X Pf">quote
84         <td class="X Po">punctuation
85         <td class="X So">symbol
86         <td class="X Sm">math
87         <td class="X Sc">currency
88         <td class="X No">numeric
89         <td class="X Greek">greek
90         <td class="X Cyrillic">cyrillic
91         <td class="X Latin">latin
92         <td class="X Hebrew">hebrew
93         <td class="X Arabic">arabic
94         <td class="X Hangul">korean
95         <td class="X Hiragana">japanese
96         <td class="X Bopomofo">chinese
97         </table>
98
99         <table class="glyphs"><tr>
100         <td class="X">unicode
101         <td class="X Xl">latin1
102         <td class="X Xa">ascii
103         <td class="X Xz">proposed
104         </table>
105 </div>
106
107 <p class="footer">
108         <a href="/" rel="home">sheet.shiar.nl</a>/digraphs.<a href="/source/digraphs.plp"
109          rel="code" title="Written in Perl">plp</a>
110         <a href="http://git.shiar.nl/sheet.git/history/HEAD:/digraphs.plp"
111          rel="vcs-git" title="Git repository"><:= $VERSION :></a>
112         created by <a href="http://shiar.nl/" rel="author">Shiar</a> •
113         <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
114          title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
115 </p>
116
117 </html>