X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=Documentation%2Fmknews.perl;h=510a4e1810558e5a74efdbdd4386bdb81b00644c;hb=6c853f5256f3a324c018a37a9e8a6b9fc8fdc063;hp=51d54b7167c19c8517b3e21787515f839b6e960d;hpb=55263c56cf41c87f8977cd6a6be65ac07b5cea87;p=public-inbox.git diff --git a/Documentation/mknews.perl b/Documentation/mknews.perl index 51d54b71..510a4e18 100755 --- a/Documentation/mknews.perl +++ b/Documentation/mknews.perl @@ -7,6 +7,7 @@ use strict; use PublicInbox::Eml; use PublicInbox::View; +use PublicInbox::Hval qw(fmt_ts); use PublicInbox::MsgTime qw(msg_datestamp); use PublicInbox::MID qw(mids mid_escape); END { $INC{'Plack/Util.pm'} and warn "$0 should not have loaded Plack::Util\n" } @@ -91,7 +92,7 @@ sub mime2txt { my $title = $mime->header('Subject'); $title =~ s/^\s*\[\w+\]\s*//g; # [ANNOUNCE] or [ANN] my $dtime = msg_datestamp($mime->header_obj); - $title .= ' - ' . PublicInbox::View::fmt_ts($dtime) . ' UTC'; + $title .= ' - ' . fmt_ts($dtime) . ' UTC'; print $out $title, "\n" or die; my $uline = '=' x length($title); print $out $uline, "\n\n" or die; @@ -103,9 +104,10 @@ sub mime2txt { sub mime2html { my ($out, $eml, $ctx) = @_; - my $smsg = bless {}, 'PublicInbox::Smsg'; + my $smsg = $ctx->{smsg} = bless {}, 'PublicInbox::Smsg'; $smsg->populate($eml); - print $out PublicInbox::View::eml_entry($ctx, $smsg, $eml, 1) or die; + $ctx->{msgs} = [ 1 ]; # for
in eml_entry + print $out PublicInbox::View::eml_entry($ctx, $eml) or die; } sub html_start {