X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/6e999e79e078ca87e22b3474d532b3d570453661..20944668da222b8510754fb4819b2b21e768840c:/browser.plp diff --git a/browser.plp b/browser.plp index 1c5bb85..2fe7500 100644 --- a/browser.plp +++ b/browser.plp @@ -36,11 +36,14 @@ my %CSTATS = ( 'p d' => 'l2', 'a d' => 'l2', 'y' => 'l5', + 'y #' => 'l4', 'y x' => 'l5 ex', + 'y x #' => 'l4 ex', 'a' => 'l3', 'a x' => 'l3 ex', 'p' => 'l2', 'u' => 'l0', + 'u d' => 'l2', ); my %DSTATS = ( u => 'unknown', @@ -83,8 +86,11 @@ while (my ($browser, $row) = each %{ $caniuse->{agents} }) { ]; } -print <<''; -

Alternate rendition of Fyrd's when can I use... page +my $ref = showlink('Can I use', 'https://caniuse.com/'); +$ref =~ s/(?=>)/ title="updated $_"/ + for map { s/[\sT].*//r } $caniuse->{-date} || (); +$ref = "Fyrd's $ref page"; +say '

Alternate rendition of '.$ref; my ($canihas, $usage); my $minusage = $get{threshold} // 1; @@ -106,7 +112,7 @@ given ($get{usage} // 'wm') { my $ref = $canihas->{-title} || 'unknown'; $ref = showlink($ref, $_) for $canihas->{-site} || $canihas->{-source} || (); - $ref .= " $_" for $canihas->{-date} || (); + $ref =~ s/(?=>)/ title="updated $_"/ for $canihas->{-date} || (); print "\nwith $ref browser usage statistics"; } @@ -195,7 +201,10 @@ $canihas ||= { # score multiplier for percentage of all browser versions my $usagepct = 99.99 / sum( - map { $_->{-total} // values %{$_} } values %{$canihas} + map { $_->{-total} // values %{$_} } + map { $canihas->{$_} } + grep { !/^-/ } + keys %{$canihas} ); $_->{usage} = featurescore($_->{stats}) * $usagepct @@ -413,6 +422,7 @@ sub saybrowsercols { )); $title .= "\n$_" for notestotitle(@notes); + $prev .= ' #' if @notes and $prev =~ /^y/; printf('%s', join(' ', X => $CSTATS{$prev}, @@ -423,7 +433,7 @@ sub saybrowsercols { ), scalar @span, $title, - showversions($span[0]->[0], @span > 1 ? $span[-1]->[-1] : ()), + showversions($span[0]->[0], @span > 1 && defined $ver ? $span[-1]->[-1] : ()), ); undef $prev; @span = (); @@ -474,6 +484,7 @@ sub showversions {

supported + annotated partial optional missing