git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard/altgr/index: label modes by description character.
[sheet.git]
/
tools
/
mkjson
diff --git
a/tools/mkjson
b/tools/mkjson
index 6a7d9489a46bcd75fe59e1a2f1b6fab531c547fc..dace34afce91d2f6ca610c2d82b10bd6d039f65b 100755
(executable)
--- a/
tools/mkjson
+++ b/
tools/mkjson
@@
-2,6
+2,12
@@
use 5.012;
use warnings;
use JSON;
use 5.012;
use warnings;
use JSON;
+use re '/msx';
+
+my %opt;
+my $jsonify = JSON->new->utf8->canonical;
+$jsonify->pretty if $opt{pretty};
my $data = do "./$ARGV[0]" or die $@;
my $data = do "./$ARGV[0]" or die $@;
-print JSON->new->utf8->canonical->encode($data);
+print $jsonify->encode($data)
+ =~ s{\[ \K\n ([^][]+) (?=\])}{$1 =~ s/(?:\A|\n) \s*//gr}reg;