summaryrefslogtreecommitdiff
path: root/localworddiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-04-21 23:02:48 +0200
committerJonas Smedegaard <dr@jones.dk>2013-04-21 23:02:48 +0200
commit7dd297223c1ac1442138e7d3a9beac593b5dadd1 (patch)
tree3903d25516a32df1cd7f6532e34160dd1e83229c /localworddiff
parent22787bdda0961e3f136c387b6ed968353d35a5c2 (diff)
Tidy code.
Diffstat (limited to 'localworddiff')
-rwxr-xr-xlocalworddiff18
1 files changed, 9 insertions, 9 deletions
diff --git a/localworddiff b/localworddiff
index e26e50c..1561684 100755
--- a/localworddiff
+++ b/localworddiff
@@ -22,16 +22,16 @@
use Text::WordDiff;
use Text::Markdown qw[markdown];
use CSS::Tiny;
-use HTML::HTML5::Builder qw[:standard];;
+use HTML::HTML5::Builder qw[:standard];
use File::Slurp;
use strictures 1;
use autodie;
-my ($infile1, $infile2, $outfile) = @ARGV;
+my ( $infile1, $infile2, $outfile ) = @ARGV;
die 'Missing input file arguments'
- unless ($infile1 and $infile2);
+ unless ( $infile1 and $infile2 );
# use console if no output file provided as third argument
unless ($outfile) {
@@ -43,19 +43,19 @@ unless ($outfile) {
my $diff = word_diff $infile1, $infile2, { STYLE => 'HTMLTwoLines' };
# apply markup to each file div of resolved diff
-my $d = "<div class=\"file\">";
+my $d = "<div class=\"file\">";
my $d_ = "<\/div>";
my $i;
my @diffchunk;
foreach ( split /(?:$d_\n)?$d/, $diff ) {
if ($_) {
- $diffchunk[$i++] = $d.markdown($_).$d_;
+ $diffchunk[ $i++ ] = $d . markdown($_) . $d_;
}
}
# parse styling
my $css = CSS::Tiny->new();
-$css->read_string (<<'EOF');
+$css->read_string(<<'EOF');
.fileheader {
display: none;
visibility: hidden;
@@ -80,11 +80,11 @@ EOF
# compose and save web page
my $page = html(
head(
- XML_CHUNK($css->html),
+ XML_CHUNK( $css->html ),
),
body(
- CHUNK($diffchunk[0]),
- CHUNK($diffchunk[1]),
+ CHUNK( $diffchunk[0] ),
+ CHUNK( $diffchunk[1] ),
),
);
write_file( $outfile, $page );