X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=Documentation%2Fmknews.perl;h=68866f44f202b6947f31bc3b056d6cb75698abcf;hb=HEAD;hp=51d54b7167c19c8517b3e21787515f839b6e960d;hpb=55263c56cf41c87f8977cd6a6be65ac07b5cea87;p=public-inbox.git diff --git a/Documentation/mknews.perl b/Documentation/mknews.perl index 51d54b71..68866f44 100755 --- a/Documentation/mknews.perl +++ b/Documentation/mknews.perl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (C) 2019-2020 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # Generates NEWS, NEWS.atom, and NEWS.html files using release emails # this uses unstable internal APIs of public-inbox, and this script @@ -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" } @@ -42,9 +43,10 @@ if ($dst eq 'NEWS') { ); $ibx->{-primary_address} = $addr; my $ctx = { - -inbox => $ibx, + ibx => $ibx, -upfx => "$base_url/", -hr => 1, + zfh => $out, }; if ($dst eq 'NEWS.html') { html_start($out, $ctx); @@ -91,7 +93,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 +105,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 { @@ -117,10 +120,10 @@ sub html_start { } sub html_end { - print $out < -EOF + for (@$PublicInbox::WwwStream::CODE_URL) { + print $out " git clone $_\n" or die; + } + print $out "\n" or die; } sub atom_start { @@ -129,7 +132,7 @@ sub atom_start { # WwwAtomStream stats this dir for mtime my $astream = PublicInbox::WwwAtomStream->new($ctx); delete $astream->{emit_header}; - my $ibx = $ctx->{-inbox}; + my $ibx = $ctx->{ibx}; my $title = PublicInbox::WwwAtomStream::title_tag($ibx->description); my $updated = PublicInbox::WwwAtomStream::feed_updated($mtime); print $out <