Linux Manual Pages development
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org
Cc: Alejandro Colomar <alx@kernel.org>,
	groff@gnu.org, cjwatson@debian.org, branden@debian.org
Subject: [PATCH v2 3/3] src/bin/mansect: Preprocess with preconv(1)
Date: Sun, 3 Nov 2024 02:17:18 +0100	[thread overview]
Message-ID: <929d1df174d5656e3e14228d990db258e0405459.1730596445.git.alx@kernel.org> (raw)
In-Reply-To: <cover.1730596445.git.alx@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

This doesn't process the pages in a significant way, and has the benefit
that it writes the name of the pages in the output.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 src/bin/mansect | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/bin/mansect b/src/bin/mansect
index a13a6b534..e1e83a8d8 100755
--- a/src/bin/mansect
+++ b/src/bin/mansect
@@ -14,13 +14,14 @@ shift;
 
 
 if test $# -lt 1; then
-	cat;
+	preconv;
 else
 	find -L "$@" -not -type d \
 	| xargs grep -l '^\.TH ' \
-	| xargs cat;
+	| xargs preconv;
 fi \
 | sed -En \
+	-e '/^\.lf 1 /p' \
 	-e '/^\.TH /p' \
 	-e '/^\.SH '"$s"'$/p' \
 	-e '/^\.SH '"$s"'$/,/^\.(TH|SH)/{/^\.(TH|SH)/!p}';
-- 
2.39.5


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2024-11-03  1:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1730596445.git.alx@kernel.org>
2024-11-03  1:16 ` [PATCH v2 1/3] scripts/bash_aliases: man_lsfunc(), man_lsvar(): Use mansect(1) Alejandro Colomar
2024-11-03  1:26   ` Alejandro Colomar
2024-11-03  1:17 ` [PATCH v2 2/3] scripts/bash_aliases: man_lsfunc(), man_lsvar(): Use pcre2grep(1) instead of pcregrep(1) Alejandro Colomar
2024-11-03  1:17 ` Alejandro Colomar [this message]

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

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

  git send-email \
    --in-reply-to=929d1df174d5656e3e14228d990db258e0405459.1730596445.git.alx@kernel.org \
    --to=alx@kernel.org \
    --cc=branden@debian.org \
    --cc=cjwatson@debian.org \
    --cc=groff@gnu.org \
    --cc=linux-man@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox