From 50f05cb638a643c70d5a78eb9cc40bdcc890ce87 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 31 Aug 2016 19:32:12 +0000 Subject: txt2pre: allow overriding title via env This will allow reasonable titles to be generated for manpages. --- Documentation/txt2pre | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation/txt2pre') diff --git a/Documentation/txt2pre b/Documentation/txt2pre index 72de0b79..2f1799fc 100755 --- a/Documentation/txt2pre +++ b/Documentation/txt2pre @@ -11,7 +11,8 @@ use PublicInbox::Linkify; use PublicInbox::Hval qw(ascii_html); my $str = eval { local $/; <> }; -my ($title) = ($str =~ /\A([^\n]+)/); +my $title = $ENV{TITLE}; +($title) = ($str =~ /\A([^\n]+)/) unless $title; $title = ascii_html($title); my $l = PublicInbox::Linkify->new; $str = $l->linkify_1($str); -- cgit v1.2.3-24-ge0c7