Commit Diff


commit - 8f7a9a4697c9b6250d14b65d66d44929975f40c8
commit + a3c4c223a6e8f25647c6e13c8769c187cb0946da
blob - 2f7230899ca5f4d92033805a91393b01842bfa75
blob + ac26003375ef1b42895589ba2d9debfc3cdde914
--- GotMArc.pm
+++ GotMArc.pm
@@ -11,7 +11,7 @@ use File::Basename;
 
 our @ISA = qw(Exporter);
 our @EXPORT_OK = qw(san urlencode parse initpage endpage index_header
-    thread_header threntry thrslice);
+    thread_header threntry thrslice thrnav);
 
 sub san {
 	my $str = shift;
@@ -182,4 +182,38 @@ sub thrslice {
 	print $fh "</ul></div>";
 }
 
+sub thrnav {
+	my ($fh, $p, $n, $mid, $tid) = @_;
+	my @prev = @{$p};
+	my @next = @{$n};
+
+	return if !@prev && !@next;
+	print $fh "<nav>";
+
+	if (@prev) {
+		my $mail = $prev[-1];
+		my $encmid = $mail->{mid};
+		say $fh "<a href='/mail/$encmid.html'>Previous</a>";
+	} else {
+		say $fh "<span>Previous</span>";
+	}
+
+	if (defined($mid) && defined($tid)) {
+		my $encmid = urlencode $mid;
+		my $enctid = urlencode $tid;
+		say $fh "<a href='/text/$encmid.txt'>Raw body</a>";
+		say $fh "<a href='/thread/$enctid.html#$encmid'>Thread</a>";
+	}
+
+	if (@next) {
+		my $mail = $next[0];
+		my $encmid = $mail->{mid};
+		say $fh "<a href='/mail/$encmid.html'>Next</a>";
+	} else {
+		say $fh "<span>Next</span>";
+	}
+
+	print $fh "</nav>";
+}
+
 1;
blob - 7edfd18e5899171341b45a0ac8d248b83b04ed2b
blob + cb957d6415f362e0852864483cbdd7951771957a
--- mexp
+++ mexp
@@ -17,7 +17,7 @@ use OpenBSD::Unveil;
 
 use lib ".";
 use GotMArc qw(parse san urlencode initpage endpage thread_header
-    threntry thrslice);
+    threntry thrslice thrnav);
 
 my $outdir = $ENV{'OUTDIR'};
 die 'Set $OUTDIR' unless defined $outdir;
@@ -57,40 +57,6 @@ sub humanize {
 	}
 }
 
-sub thrnav {
-	my ($fh, $p, $n, $mid, $tid) = @_;
-	my @prev = @{$p};
-	my @next = @{$n};
-
-	return if !@prev && !@next;
-	print $fh "<nav>";
-
-	if (@prev) {
-		my $mail = $prev[-1];
-		my $encmid = $mail->{mid};
-		say $fh "<a href='/mail/$encmid.html'>Previous</a>";
-	} else {
-		say $fh "<span>Previous</span>";
-	}
-
-	if (defined($mid) && defined($tid)) {
-		my $encmid = urlencode $mid;
-		my $enctid = urlencode $tid;
-		say $fh "<a href='/text/$encmid.txt'>Raw body</a>";
-		say $fh "<a href='/thread/$enctid.html#$encmid'>Thread</a>";
-	}
-
-	if (@next) {
-		my $mail = $next[0];
-		my $encmid = $mail->{mid};
-		say $fh "<a href='/mail/$encmid.html'>Next</a>";
-	} else {
-		say $fh "<span>Next</span>";
-	}
-
-	print $fh "</nav>";
-}
-
 sub export_one {
 	my ($mail, $prev, $next) = @_;
 	my $dest = "$outdir/mail/$mail->{mid}.html";