git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard/altgr/index: hardcoded includes list
[sheet.git]
/
keyboard
/
altgr
/
index.inc.plp
diff --git
a/keyboard/altgr/index.inc.plp
b/keyboard/altgr/index.inc.plp
index 9e4d6b53dc88bf3e2b99995d45a9a61a4bfd6708..208cae215e3e2cc3256e64c1051f3048203d7dd9 100644
(file)
--- a/
keyboard/altgr/index.inc.plp
+++ b/
keyboard/altgr/index.inc.plp
@@
-3,7
+3,8
@@
use 5.014;
use warnings;
use utf8;
use warnings;
use utf8;
-my @incs = glob 'keyboard/altgr/*.eng.inc.pl';
+my $dirbase = 'keyboard/altgr';
+my $indexfile = "$dirbase/index";
Html({
title => "altgr keyboard cheat sheets",
Html({
title => "altgr keyboard cheat sheets",
@@
-16,9
+17,9
@@
Html({
keywords => [qw'
sheet cheat reference overview keyboard altgr option
'],
keywords => [qw'
sheet cheat reference overview keyboard altgr option
'],
- image =>
'data/keyboard/thumb/ibm-m.jpg'
,
+ image =>
"$dirbase/thumb/ibm-m.jpg"
,
stylesheet => [qw( light dark circus mono red )],
stylesheet => [qw( light dark circus mono red )],
- data => [
'keyboard/altgr/index.inc.plp', @incs
],
+ data => [
"$dirbase/index.inc.plp", "$indexfile.inc.pl"
],
raw => <<'.',
<style>
.keys.cmp {
raw => <<'.',
<style>
.keys.cmp {
@@
-113,6
+114,10
@@
img {
<p>Overview of available key layouts with AltGr or similar modifier keys.</p>
<:
<p>Overview of available key layouts with AltGr or similar modifier keys.</p>
<:
+my $idx = Data($indexfile);
+my @incs;
+push @incs, @{ $idx->{$_} } for @{ $idx->{default} };
+
my @sample = split /(?<!\+)/, $get{sample} // 'asSci1!+1';
require Shiar_Sheet::Keyboard;
use List::Util qw( uniq max );
my @sample = split /(?<!\+)/, $get{sample} // 'asSci1!+1';
require Shiar_Sheet::Keyboard;
use List::Util qw( uniq max );
@@
-131,14
+136,11
@@
if (@sample) {
print "<th>$_" for @sample;
say '</tr></thead>';
}
print "<th>$_" for @sample;
say '</tr></thead>';
}
-my %idx = map {
s/\Q.inc.pl\E$//; ($_ => eval{ Data($_
) })} @incs;
+my %idx = map {
($_ => scalar eval{ Data("$dirbase/$_.eng"
) })} @incs;
my $most = max(map { scalar keys %{$_->{def}{''}} } values %idx);
my $most = max(map { scalar keys %{$_->{def}{''}} } values %idx);
-for my $inc (sort {
- ($idx{$a}{category} // 0) cmp ($idx{$b}{category} // 0)
- || $a cmp $b
-} keys %idx) {
+for my $inc (@incs) {
print @sample ? '<tr><th>' : '<figure>';
print @sample ? '<tr><th>' : '<figure>';
- printf '<a href="/%s">',
$inc =~ s/\.eng$//r
;
+ printf '<a href="/%s">',
"$dirbase/$inc"
;
my $table = $idx{$inc};
my $title = $table && $table->{title} || $inc;
my $table = $idx{$inc};
my $title = $table && $table->{title} || $inc;