(common.inc.plp)><:
my ($page, @feat) = split m{/+}, $Request || 'image';
$page !~ /\W/ or Html(), Abort('Invalid codec type request', 400);
@feat or @feat = 'default';
my $title = "$page codecs";
my $info = eval { Data("codec-$page") };
if ($@) {
$info = {};
}
Html({
title => "$title cheat sheet",
version => '1.1',
description => $info->{intro},
keywords => [@{ $info->{keywords} // [] }, qw' feature comparison support benchmark '],
stylesheet => [qw'light circus dark red'],
data => ["codec-$page.inc.pl"],
raw => '',
});
%{$info}
or Abort("Requested codec type $page
not available", '404 request not found');
say "
$_
" for $info->{intro} // (); my %BOOLSCORE = (y => [5, '✔'], n => [1, '✘'], 0 => [0, 'n/a']); :>'; say "\t", ' | ', $_->{name} for @codeccols; print ' |
---|---|
', $_->{available} for @codeccols; say ' | |
%s', $featinfo->{name} // $feat; for (@codecs) { my ($score, $data, $title) = map { ref ? @$_ : $_ } $featinfo->{score}->{$_}; if (not defined $data) { if (my $override = $BOOLSCORE{$score}) { ($score, $data) = @{$override}; } else { $data = '•' x ($score - 1); } } printf ' | ', $data; } say ' | '; } :>