Content deleted Content added
Updating published sources: General: * Have the bot script watch for changes and automatically re-exec itself. SourceUploader: * Change things around so task metadata is stored with the task. |
Updating published sources: TagDater: * When check_page2 was split from check_page for unit testing purposes, some function calls weren't updated properly so check_page() was getting called with wrong arguments. General: * Apparently @_ holds implicit... |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1:
<
package tasks::SourceUploader::Pod;
use utf8;
use strict;
use Pod::Simple;
Line 12 ⟶ 13:
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->encoding( 'utf8' ) if $self->can('encoding');
$self->accept_targets('*');
$self->{'stack'}=[];
Line 32 ⟶ 34:
target=>$_[1]{'target'},
para=>[],
line=>
};
} elsif($_[0] eq 'Data'){
Line 46 ⟶ 48:
$s=$s->[$#$s]{'para'};
return unless @$s;
my $txt = $_[0]
$
$txt=~s
$s->[$#$s].=$txt;
}
Line 73 ⟶ 76:
s/^\s*|\s*$//g;
if(!/^(\S+?):\s*(.*)$/){
next;
}
$metadata{lc($1)}=[] unless exists($metadata{lc($1)});
push @{$metadata{lc($1)}}, $2;
} else {
$metadata{lc($1)}=$2;
}
}
my $text=join("\n\n", @para);
$text=~s/([^\n])\n(?=[a-zA-Z0-9< ])/$1 /g; # unwrap lines
$metadata{'*'}=$text;
$self->{'metadata'}=\%metadata;
Line 102 ⟶ 110:
my $text=join("\n\n", @{$_[0]});
$text=~s/\n(?=[a-zA-Z0-9])/ /g; # unwrap lines
print {$self->output_fh} "\x7b\x7bombox|type=
}
1;
</syntaxhighlight>
|