diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-12-30 01:50:08 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-12-30 01:50:08 +0100 |
commit | 6f98b4dfb2b80e3eb3072dd3f140351581746db2 (patch) | |
tree | 3504d7481f617648637af7e3209bb32f45e605c0 /mediawiki-trim | |
parent | 5b493a9bf8356bce9472256a3a2a16c3b7ab2643 (diff) |
Move mediawiki tweaks to separate scripts.
Diffstat (limited to 'mediawiki-trim')
-rwxr-xr-x | mediawiki-trim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mediawiki-trim b/mediawiki-trim new file mode 100755 index 0000000..a67d205 --- /dev/null +++ b/mediawiki-trim @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +# drop content above initial headline - i.e. treat it as editorial noise + +use warnings; +use strict; + +use Path::Tiny; +use HTML::Entities; + +my $infile = shift; +my $outfile = shift || $infile; + +$_ = path($infile)->slurp_utf8; + +s!.*?\n= != !s; + +path($outfile)->spew_utf8($_); + +1; |