user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/6] doc: txt2pre: linkify "lei COMMAND" form
Date: Thu,  3 Nov 2022 00:48:35 +0000	[thread overview]
Message-ID: <20221103004838.26331-4-e@80x24.org> (raw)
In-Reply-To: <20221103004838.26331-1-e@80x24.org>

While manpages are named `L<lei-COMMAND(1)>', `lei COMMAND'
can be worth linkifying for ease-of-navigation, too.
---
 Documentation/txt2pre | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/txt2pre b/Documentation/txt2pre
index c8dbd2ba..82573a30 100755
--- a/Documentation/txt2pre
+++ b/Documentation/txt2pre
@@ -9,7 +9,7 @@ use strict;
 use warnings;
 use PublicInbox::Linkify;
 use PublicInbox::Hval qw(ascii_html);
-my %xurls;
+my (%xurls, %lei);
 for (qw[lei(1)
 	lei-add-external(1)
 	lei-add-watch(1)
@@ -77,6 +77,7 @@ for (qw[lei(1)
 	my ($n) = (/([\w\-\.]+)/);
 	$xurls{$_} = "$n.html";
 	$xurls{$n} = "$n.html";
+	/\Alei-(.+?)\(1\)\z/ and $xurls{"lei $1"} = "$n.html";
 }
 
 for (qw[make(1) flock(2) setrlimit(2) vfork(2) tmpfs(5) inotify(7) unix(7)
@@ -161,6 +162,9 @@ if ($str =~ /^NAME\n\s+([^\n]+)/sm) {
 	if ($title =~ /([\w\.\-]+)/) {
 		delete $xurls{$1};
 	}
+	if ($title =~ /\blei-([\w\-]+)\b/) {
+		delete $xurls{"lei $1"};
+	}
 }
 $title = ascii_html($title);
 my $l = PublicInbox::Linkify->new;

  parent reply	other threads:[~2022-11-03  0:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  0:48 [PATCH 0/6] doc: linkify HTML harder Eric Wong
2022-11-03  0:48 ` [PATCH 1/6] doc: txt2pre: linkify new commands Eric Wong
2022-11-03  0:48 ` [PATCH 2/6] doc: lei: improve description of *-search commands Eric Wong
2022-11-03  0:48 ` Eric Wong [this message]
2022-11-03  0:48 ` [PATCH 4/6] doc: txt2pre: modernize and use v5.12 Eric Wong
2022-11-03  0:48 ` [PATCH 5/6] doc: lei-import: link to lei-store-format(5) Eric Wong
2022-11-03  2:03   ` Eric Wong
2022-11-03  0:48 ` [PATCH 6/6] txt2pre: linkify lei/store => lei-store-format.html Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221103004838.26331-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).