use utf8;
use strict;
use warnings;
+no warnings 'qw'; # that's not a comment, it's a NUMBER SIGN
use open IO => ':utf8';
our $VERSION = '1.0';
<title>digraph cheat sheet</title>
<meta http-equiv="content-type" content="utf-8">
<link rel="stylesheet" type="text/css" media="all" href="/digraphs.css">
-<style>
-table {
- margin: 1ex 1ex 2ex;
- float: left;
- table-layout: auto;
-}
-thead td {
- width: auto;
-}
-tbody {
- border-width: 0;
-}
-h2, h3 {
- clear: both;
-}
-
-th {
- text-align: left;
- font-size: 50%;
- background: #888;
- color: #FFF;
- padding: 0 0.2em;
-}
-thead td {
- border: 0;
-}
-
-td {
- background: transparent;
- vertical-align: top;
- margin: 0;
- padding: 0;
- width: 1.6em;
-}
-small {
- font-size: 50%;
- display: block;
-}
-small.digraph {
- background: #888;
- color: #FFF;
-}
-small.value {
- background: #CCC;
- color: #666;
-}
-
-td.empty {
- background: #DDD;
-}
-td.reserved {
- background: #BBB;
-}
-</style>
</head>
<body>
-<h1>Common Digraphs</h1>
+<h1>Common uncommon Unicode</h1>
<p>i^k in <a href="/">Vim</a>.
Also see the <a href="/digraphs">complete digraphs table</a>.</p>
+<div class="diinfo">
+
<:
my $diinfo = do 'digraphs.inc.pl';
my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
$colspan++;
next;
}
- elsif ($cell =~ s/^-//) {
- $class = 'empty';
+
+ my $code = join '', map { $di{ord $_} || '' } split //, $cell;
+ my $name = $diinfo->{$code}->[1];
+
+ if ($cell =~ s/^-//) {
+# $class = 'Empty';
}
elsif ($cell eq '=') {
- $class = 'reserved';
+ $class = 'Reserved';
$cell = '';
}
-
- my $code = join '', map { $di{ord $_} || '' } split //, $cell;
- my $name = $diinfo->{$code}->[1];
+ elsif ($cell =~ /[ -~]/) {
+ $class = 'Ascii';
+ }
+ elsif (not $code) {
+ $class = 'DiNone';
+ }
+ elsif ($diinfo->{$code}->[2] =~ /\bXz\b/) {
+ $class = 'DiProp';
+ }
+ else {
+ $class = 'Di';
+ }
$rows[-1] .= sprintf('<td%s%s%s>%s%s',
defined $name ? qq{ title="$name"} : '',
if ($colheads) {
unshift @rows, sprintf '<thead><tr><td>%s<tbody>', join '',
- map { sprintf '<th title="%2$s">%s', split(/:/, $_, 2) }
+ map { sprintf '<th title="%2$s">%s', split(/:/, $_, 2), '', '' }
@$colheads
}
- return sprintf "<table>\n%s</table>\n", join '', map {"<tr>$_\n"} @rows;
+ return sprintf qq{<table class="glyphs dilabel">\n%s</table>\n},
+ join '', map {"<tr>$_\n"} @rows;
}
-print "<h2>Common</h2>\n\n";
+print "<div>\n", "<h2>Popular</h2>\n\n";
print table(@$_) for (
[ 3 => [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚}]],
[ 3 => [qw{. † ‡ • . § ¶ # . © ® ™ . − × ÷ . ± ² √}]],
[ 3 => [qw{. å ä ö ü ß . Å æ ø ű ſ}]],
[ 3 => [qw{. ¿ ç ñ é ê è}]],
);
+print "</div>\n\n";
-print "<h2>Arrows</h2>\n\n";
+print "<div>\n", "<h2>Arrows</h2>\n\n";
print table(@$_) for (
[ 4 => [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}]],
- [ 4 => [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . �� ⇓ ⇙ -}]],
+ [ 4 => [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . �� ⇓ ⇘ -}]],
[ 3 => [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢}]],
[ 3 => [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿}]],
);
+print "</div>\n\n";
-print "<h2>Line drawing</h2>\n\n";
+print "<div>\n", "<h2>Line drawing</h2>\n\n";
print table(@$_) for (
[ 4 => [qw{. ┌ ┬ ┐ . ├ ┼ ┤ . └ ┴ ┘}]],
[ 4 => [qw{. ┏ ┳ ┓ . ┣ ╋ ┫ . ┗ ┻ ┛}]],
[ 3 => [qw{. ╒ ╤ ╕ . ╞ ╪ ╡ . ╘ ╧ ╛ }]],
[ 3 => [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }]],
);
+print "</div>\n\n";
-print "<h2>Signs</h2>\n\n";
+print "<div>\n", "<h2>Blocks</h2>\n\n";
print table(@$_) for (
- [ 3 => [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ . ░ ▒ ▓}]],
+ [ 3 => [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ }]],
+ [ 3 => [qw{. ░ . ▒ . ▓ }]],
+ [ 2 => [qw{. ▛ ▚ ▟ . ▙ ▞ ▜ }]],
+ [ 2 => [qw{. ▁ ▂ ▃ ▄ ▅ ▆ ▇ ▔ . ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▕ }]],
[ 3 => [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}]],
- [ 4 => [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}]],
- [ 5 => [qw{. ☼ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}]], # solar
-# [12 => [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}]], # zodiac
+);
+print "</div>\n\n";
+
+print "<div>\n", "<h2>Signs</h2>\n\n";
+print table(@$_) for (
[ 8 => [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}]],
+ [ 4 => [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}]],
+ [ 5 => [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}]], # solar
+ [12 => [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}]], # zodiac
);
+print "</div>\n\n";
-print "<h2>IPA</h2>\n\n";
+print "<div>\n", "<h2>IPA</h2>\n\n";
print table(@$_) for (
[
12 => [qw{
[map {substr($_, 0, 1).':'.$_, substr($_, 0, 1)." r:$_ rounded"} qw{Front Central Back}]
],
);
+print "</div>\n\n";
-print "<h2>Japanese</h2>\n\n";
+print "<div>\n", "<h2>Alphabetics</h2>\n\n";
+print table(1,
+ [ map { ('.', split //, $_->[1]) } @$_ ],
+ [ map { $_->[0] } @$_ ],
+) for [
+ [Latin => 'aīıęôɳŋṡšđðƷ'],
+ [Cyrillic => 'аійэёнњшщчьЯ'],
+ [Greek => 'αίϊηϋπψσςθξΩ'],
+ [Hebrew => 'אײיעונןסשטצץ'],
+];
+print "</div>\n\n";
+
+print "<div>\n", "<h2>Japanese</h2>\n\n";
print table(@$_) for (
[
1 => [qw{
[qw{A I U E O}],
],
);
+print "</div>\n\n";
+
+:></div>
+
+<p id="footer">
+ <a href="http://vi.shiar.net/unicode">vi.<strong>shiar.net</strong>/unicode</a>
+ <a href="git://dev.shiar.net/vi-cheat"><:= "v$VERSION" :></a>
+ created by Shiar •
+ <a title="Licensed under the GNU Affero General Public License, version 3"
+ href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
+ last update <:
+ use Time::Format qw(time_format);
+ print time_format('yyyy-mm-dd', (stat $ENV{SCRIPT_FILENAME})[9]);
+ :>
+</p>
+
+</html>