public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/2] New sman(1) script
@ 2026-01-27  9:20 Seth McDonald
  2026-01-27  9:20 ` [RFC PATCH v1 1/2] src/bin/sman: Add script Seth McDonald
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Seth McDonald @ 2026-01-27  9:20 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- 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 --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-01-29 22:20 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27  9:20 [RFC PATCH v1 0/2] New sman(1) script Seth McDonald
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox