diff options
author | Eric Wong <e@80x24.org> | 2016-08-31 19:32:12 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-08-31 19:32:12 +0000 |
commit | 50f05cb638a643c70d5a78eb9cc40bdcc890ce87 (patch) | |
tree | d16c75d67d83746560219dd7b0d81d1e0c82416a | |
parent | dfb1ed795ba2890b710b3faee82db9ccdf888e17 (diff) | |
download | public-inbox-50f05cb638a643c70d5a78eb9cc40bdcc890ce87.tar.gz |
This will allow reasonable titles to be generated for manpages.
-rw-r--r-- | Documentation/include.mk | 2 | ||||
-rwxr-xr-x | Documentation/txt2pre | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/include.mk b/Documentation/include.mk index 51a914b3..4583f951 100644 --- a/Documentation/include.mk +++ b/Documentation/include.mk @@ -59,7 +59,7 @@ dtxt := design_notes.txt design_www.txt dc-dlvr-spam-flow.txt dtxt := $(addprefix Documentation/, $(dtxt)) $(mantxt) %.html: %.txt - $(txt2pre) + TITLE="$(basename $(<F))" $(txt2pre) %.html: % $(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); |