From: Seth McDonald <sethmcmail@pm.me>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org
Subject: [RFC PATCH v1 0/2] New sman(1) script
Date: Tue, 27 Jan 2026 09:20:26 +0000 [thread overview]
Message-ID: <cover.1769497513.git.sethmcmail@pm.me> (raw)
[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]
G'day,
When parsing man pages, I've noticed I'm often only interested in a
particular set of sections within the page (e.g. SYNOPSIS, HISTORY).
And since skimming through the page to get to these sections can get
monotonous, I wrote up a small bash script to automate the process.
As far as I can tell, no program in src/bin/ can currently do this. The
closest is mansect(1), but that outputs the source code rather than the
rendered page. So I've improved the script somewhat and written a brief
man page for it, as included in this patch set.
The main advantage to this script as opposed to manually awk(1)ing or
sed(1)ing man pages is it can preserve the bold/italic formatting in a
rendered man page. It currently does so by using sed(1) to locate the
section headers with regex which includes the relevant ANSI escape codes
dictating bold and regular text.
I would consider this script a WIP still, and likely shouldn't yet be
pushed without further edits. The purpose of this patch set is to gauge
interest in and comments on this script, moreso than to be immediately
applied to the repo.
As an example, the script currently re-renders the whole man page for
each section in a for loop, rather than printing each section from the
same rendered page, which would likely be more performant. I also named
the script sman(1) primarily because I can't think of a better name.
Feel free to give your thoughts!
Seth McDonald (2):
src/bin/sman: Add script
man/man1/sman.1: Add man page
man/man1/sman.1 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++
src/bin/sman | 54 ++++++++++++++++++++++++++++++++++++++
2 files changed, 123 insertions(+)
create mode 100644 man/man1/sman.1
create mode 100755 src/bin/sman
Range-diff against v0:
-: ------------ > 1: d093a884e5fb src/bin/sman: Add script
-: ------------ > 2: e1849d315c95 man/man1/sman.1: Add man page
base-commit: 6754bd1a126ed1e9b7d9c2bc1d221681f5182bb3
--
2.47.3
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 322 bytes --]
next reply other threads:[~2026-01-27 9:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 9:20 Seth McDonald [this message]
2026-01-27 9:20 ` [RFC PATCH v1 1/2] src/bin/sman: Add script Seth McDonald
2026-01-28 16:52 ` наб
2026-01-28 17:19 ` Alejandro Colomar
2026-01-28 19:07 ` G. Branden Robinson
2026-01-28 22:02 ` наб
2026-01-28 22:31 ` G. Branden Robinson
2026-01-27 9:20 ` [RFC PATCH v1 2/2] man/man1/sman.1: Add man page Seth McDonald
2026-01-27 13:47 ` [RFC PATCH v1 0/2] New sman(1) script Alejandro Colomar
2026-01-28 4:44 ` Seth McDonald
2026-01-28 5:48 ` G. Branden Robinson
2026-01-28 14:36 ` Alejandro Colomar
2026-01-28 14:47 ` Alejandro Colomar
2026-01-28 18:55 ` [PATCH v2] src/bin/mansectf, man/man1/mansectf.1: Add program and manual page Alejandro Colomar
2026-01-29 5:50 ` Seth McDonald
2026-01-29 11:27 ` Alejandro Colomar
2026-01-29 14:31 ` New PARAMETERS section in manual pages (was: [PATCH v2] src/bin/mansectf, man/man1/mansectf.1: Add program and manual page) Alejandro Colomar
2026-01-29 20:24 ` G. Branden Robinson
2026-01-29 22:06 ` Alejandro Colomar
2026-01-29 22:20 ` G. Branden Robinson
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=cover.1769497513.git.sethmcmail@pm.me \
--to=sethmcmail@pm.me \
--cc=alx@kernel.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