* [PATCH 2/3] txt2pre: allow overriding title via env
2016-09-01 18:20 6% [PATCH 0/3] documentation build changes Eric Wong
@ 2016-09-01 18:20 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-09-01 18:20 UTC (permalink / raw)
To: meta
This will allow reasonable titles to be generated for
manpages.
---
Documentation/include.mk | 2 +-
Documentation/txt2pre | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/include.mk b/Documentation/include.mk
index 51a914b..4583f95 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 72de0b7..2f1799f 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);
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] documentation build changes
@ 2016-09-01 18:20 6% Eric Wong
2016-09-01 18:20 7% ` [PATCH 2/3] txt2pre: allow overriding title via env Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-09-01 18:20 UTC (permalink / raw)
To: meta
In preparation for more documentation...
Eric Wong (3):
txt2pre: use public-inbox internal APIs
txt2pre: allow overriding title via env
doc: set release and section properly for manpages
.gitignore | 1 +
Documentation/.gitignore | 2 +-
Documentation/include.mk | 23 ++++++++++++++++++-----
Documentation/public-inbox-mda.pod | 4 ++--
Documentation/txt2pre | 33 ++++++++++++---------------------
MANIFEST | 5 +++++
6 files changed, 39 insertions(+), 29 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-09-01 18:20 6% [PATCH 0/3] documentation build changes Eric Wong
2016-09-01 18:20 7% ` [PATCH 2/3] txt2pre: allow overriding title via env Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).