X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/69a605876ce089075ae4fe8ca76c85630a8c6897..068f457f9a60a17ca141d3b90bd7dee9aa7267bc:/browser.plp diff --git a/browser.plp b/browser.plp index 330b443..16aad08 100644 --- a/browser.plp +++ b/browser.plp @@ -9,7 +9,7 @@ Html({ "caniuse.", keywords => [qw'html css browser feature'], stylesheet => [qw'light dark circus mono red'], - data => ['caniuse.js'], + data => ['browser-support.inc.pl'], }); :> @@ -20,29 +20,7 @@ with Wikimedia browser usage statistics.

<: -use JSON; -use File::Slurp 'read_file'; -my $source = read_file('caniuse.js'); -for ($source) { # cleanup - # convert seperate variables to hash keys - s/\A/{/; - s/^caniuse\.(\w+) = /"$1":/gm; - s/;$/,/gm; - s/,\s*\Z/\n}/; - # fractions not supported by barekey - s/(?<=[,{]) (\d*\.\d) (?=:')/"$1"/gx; - # escapes not supported in singlequote - s{'((?:[^\\']+|\\.)*)'}{ - my $_ = $1; - s/"/\\"/g; - s/\\'/'/g; - qq("$_"); - }ge; -} -my $caniuse = from_json($source, { -# allow_singlequote => 1, - allow_barekey => 1, -}); +my $caniuse = do 'browser-support.inc.pl' or die $! || $@; my %CSTATS = ( n => 'di-b',