X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/4f067d460821f15ab66522dd9cef5f0342b2dfc3..3cc083e4183098368fcff9130ae670b1661f9e7b:/keyboard/altgr/index.inc.plp
diff --git a/keyboard/altgr/index.inc.plp b/keyboard/altgr/index.inc.plp
index ccb7fb6..0bb7774 100644
--- a/keyboard/altgr/index.inc.plp
+++ b/keyboard/altgr/index.inc.plp
@@ -6,7 +6,7 @@ my @incs = glob 'keyboard/altgr/*.eng.inc.pl';
Html({
title => "altgr keyboard cheat sheets",
- version => '1.1',
+ version => '1.2',
description => [
"Overview of alternate keyboard modes,",
"offering extended Unicode characters if a modifier key",
@@ -46,6 +46,37 @@ Html({
text-align: right;
}
+.graph {
+ display: block;
+ line-height: 1ex;
+ height: 1.2ex;
+ margin-top: .4ex;
+}
+.graph ~ .graph {
+ /* subsequent graphs */
+ height: .7ex;
+}
+.graph > * {
+ display: inline-block;
+ height: 100%;
+ vertical-align: top;
+}
+.graph > label {
+ font-size: 75%;
+ margin-right: .2em;
+}
+.graph > span {
+ border: 1px solid #000;
+ border-right-width: 0;
+ font-size: 0;
+}
+.graph > :last-of-type {
+ border-right-width: 1px;
+}
+.graph > .ext {
+ border-left: 0; /* assume following unext */
+}
+
img {
object-fit: cover;
height: 100%;
@@ -63,6 +94,7 @@ img {
<:
my @sample = split /(?', @sample ? 'section' : 'gallery';
if (@sample) {
@@ -72,6 +104,7 @@ if (@sample) {
say '';
}
my %idx = map {s/\Q.inc.pl\E$//; ($_ => eval{ Data($_) })} @incs;
+my $most = max(map { scalar keys %{$_->{def}{''}} } values %idx);
for my $inc (sort {
$idx{$a}{category} cmp $idx{$b}{category} || $a cmp $b
} keys %idx) {
@@ -90,10 +123,23 @@ for my $inc (sort {
}
else {
print $title;
- print '';
+ print '', "\n\t";
my $keys = Shiar_Sheet::Keyboard->new($table);
- print '
', join(' ', map { $keys->{key}{$_} =~ s/\s.*//r } grep {$_} keys %{$_})
- for $keys->{mode} || ();
+ for my $mode ($keys->{mode} ? sort keys %{ $keys->{mode} } : '') {
+ my %inventory;
+ $inventory{ s/ (?!ext).*//r }++ for values %{ $keys->{def}{$mode} };
+ print '';
+ print "" for $keys->{key}{$mode} =~ s/\s.*//r || ();
+ for my $g (sort keys %inventory) {
+ printf ' %s',
+ $g, $_/$most*100, $_,
+ join(' ', map {
+ $keys->{flag}{$_}[0] || 'extra' # legend label of each class
+ } reverse split / /, $g)
+ for $inventory{$g};
+ }
+ say '';
+ }
$keys->print_key('', $_, $keys->{def}{''}{$_} // 'ni') for @sample;
say '';
}