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