public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* diffman(1)
@ 2024-11-25 12:44 Alejandro Colomar
  2024-11-25 13:35 ` diffman(1) Alejandro Colomar
  2024-11-25 16:08 ` diffman(1) onf
  0 siblings, 2 replies; 8+ messages in thread
From: Alejandro Colomar @ 2024-11-25 12:44 UTC (permalink / raw)
  To: linux-man, groff

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

Hi!

I've developed a new program (actually, a bash script) that diffs manual
pages.  I find it quite useful for quickly seeing differences between a
page as installed in the system, and the file I'm working on.  The
output is diff -u of formatted manual pages (suitable for less -R).

You can find it here:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=fa4743c43762cc3be4af9672ce12a7ed58f9a500>
and soon in the <kernel.org> repo.

The script is just a fancy version of

	diff -u \
	       <(man -w "$1" | xargs groff -man -Tutf8) \
	       <(man -w "$2" | xargs groff -man -Tutf8);

I had to make it fancier for error handling, since process substitution
doesn't propagate errors (not even with `set -Eeo pipefail`).

You may find it useful for development of manual pages.  If so, please
let me know any feedback you have for it.  I was wondering if I should
pipe to less -R, just like man(1) does.  For now, having doubts, I kept
it simple, which would allow wrapping this in fancier scripts that for
exaple diff an entire repository of manual pages (although that maybe
calls for running groff(1) and diff(1) directly).

Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

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

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

end of thread, other threads:[~2025-01-10  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 12:44 diffman(1) Alejandro Colomar
2024-11-25 13:35 ` diffman(1) Alejandro Colomar
2024-11-25 16:08 ` diffman(1) onf
2024-11-25 16:34   ` diffman(1) Alejandro Colomar
2025-01-09 13:59     ` duffman(1) (was: diffman(1)) Alejandro Colomar
2025-01-10  4:30       ` onf
2025-01-10  9:17         ` Alejandro Colomar
2025-01-10  9:45           ` onf

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