X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/a12fd2846834c96aaf034aca4c749f9e217af1a9..refs/tags/v1.9:/browser.plp?ds=sidebyside diff --git a/browser.plp b/browser.plp index e65395e..0fc1627 100644 --- a/browser.plp +++ b/browser.plp @@ -2,26 +2,27 @@ use 5.010; use utf8; use List::Util qw(sum max first); +no if $] >= 5.018, warnings => 'experimental::smartmatch'; Html({ title => 'browser compatibility cheat sheet', - version => 'v1.0', + version => '1.4', description => [ "Compatibility table of new web features (HTML5, CSS3, SVG, Javascript)", "comparing support and usage share for all popular browser versions.", ], keywords => [qw' - web browser support compatibility usage available feature + web browser support compatibility usage matrix available feature html html5 css css3 svg javascript js dom mobile ie internet explorer firefox chrome safari webkit opera '], stylesheet => [qw'circus dark mono red light'], - data => ['browser-support.inc.pl'], + data => ['data/browser/support.inc.pl'], }); say "
Alternate rendition of Fyrd's when can I use... page my ($canihas, $usage); -my $minusage = $get{threshold} // .5; +my $minusage = $get{threshold} // .7; given ($get{usage} // 'wm') { when (!$_) { # none } - when (!/^[a-z][\w-]+$/) { + when (!m{ \A [a-z]\w+ (?:/\d[\d-]*\d)? \z }x) { printf "
Invalid browser usage data request: %s",
'identifier must be alphanumeric name or 0
';
}
- $canihas = do "browser-usage-$_.inc.pl" or do {
- printf "
Browser usage data not found: %s", $! || $@; + $canihas = do "data/browser/usage-$_.inc.pl" or do { + printf "
Browser usage data not found: %s", $@ || $!; break; }; $usage = $_; @@ -159,6 +169,7 @@ if ($usage) { # first() does not work inside given >:( } else { # order browser columns by name grouped by engine + @{$_} = map { [$_] } @{$_} for values %versions; @browsers = sort { $caniuse->{agents}->{$b}->{prefix} cmp $caniuse->{agents}->{$a}->{prefix} @@ -199,7 +210,7 @@ say '
$1
}gx;
+ s{ \[ ([^]]*) \] \( ([^)]*) \) }{$1}gx;
+ }
+ return @html;
+}
+
sub saytitlecol {
my ($id) = @_;
my $row = $caniuse->{data}->{$id};
@@ -311,11 +331,15 @@ sub saytitlecol {
);
} $row->{title};
print '$_
" for map { ref $_ ? @$_ : $_ || () } - Entity($row->{description}), - map { s/\s*\n/\n$_
" + for formatnotes($row->{description}, $row->{notes} || ()); + if (my %notes = %{ $row->{notes_by_num} }) { + say 'Browser-specific notes:';
+ say "
#$_: ", formatnotes($notes{$_}) for sort keys %notes;
+ say '