package Iotta::Format::In::Daylog;
require Iotta::Elem;
@ISA = ("Iotta::Elem");
sub run {
my $s = shift;
my $m = shift;
my $in = shift;
my $out;
print " parsing daylog format...\n";
$_ = $in;
s/&/&/g;
s/</</g;
s/>/>/g;
#my @sects = split /\n\n/, $in;
$out = "<iotta-ifmt>\n";
s/^\n+//s;
while (s/^T (.*?)\n//s) {
$out .= "\t<par>\n\t\t<text class=\"log-time\">$1</text>\n";
my $t = 1;
while (s/^E (.*?)\n//s) {
$out .= "\t<par>\n\t\t<text class=\"log-time\">"
." </text>\n" unless ($t);
$t = 0;
$out .= "\t\t<text class=\"log-entry\">$1\n";
while (s/^A (.*?)\n//s) {
$out .= "$1\n";
}
$out .= "</text><br />\n";
s/^\n+//s;
$out .= "</par>\n";
}
s/^\n+//s;
}
$out .= "</iotta-ifmt>\n";
$s->next->run ($m, $out) if ($s->next);
}
sub setup {
my $self = shift;
my $o = shift;
}
sub initialize {
my $self = shift;
$self->SUPER::initialize (@_);
}
1;
Platon Group <platon@platon.sk> http://platon.sk/
|