git.shiar.nl
/
sheet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
keyboard/altgr: label keys in each row with big class
[sheet.git]
/
tools
/
mkjson
1
#!/usr/bin/env perl
2
use 5.012;
3
use warnings;
4
use JSON;
5
use re '/msx';
6
7
my %opt;
8
my $jsonify = JSON->new->utf8->canonical;
9
$jsonify->pretty if $opt{pretty};
10
11
my $data = do "./$ARGV[0]" or die $@;
12
print $jsonify->encode($data)
13
=~ s{\[ \K\n ([^][]+) (?=\])}{$1 =~ s/(?:\A|\n) \s*//gr}reg;