Subject: Re: what man(1) reads
To: James K. Lowden <jklowden@schemamania.org>
From: Phillip Rulon <pjr@gnu.org>
List: netbsd-help
Date: 06/16/2002 14:18:57
On Sunday 16 June 2002 01:41 pm, James K. Lowden wrote:
> On 15 Jun 2002 16:55:21 -0400, "Perry E. Metzger" <perry@piermont.com>
>
> wrote:
> > "James K. Lowden" <jklowden@schemamania.org> writes:
> > > I'm using txt2man, and it's producing some not-quite-right output.  I
> > > want to tweak it, but I can't seem to find the nroff (?) macros that
> > > man pages use.

I recently went through this while documenting some new code I'm working
on.  It was initially confusing but once I discovered that I'm using mdoc
not man it went smoothly.

$ locate mdoc
/usr/share/man/man7/mdoc.7
/usr/share/man/man7/mdoc.samples.7
/usr/share/misc/mdoc.template

With these it took fairly small investment to get good man page built up.

> Perry,
> Despite your kind help, I'm still hosed, as far as I can tell.  The
> txt2man DESC should say, "Broken.  Use something better."
>
> Problem is, unless I'm blind, is that I've got mdoc(7) and man(7), but
> precious little on troff, whose page says, "Only the features not in Unix
> troff are described here", and of course /usr/share/doc/usd/21.troff/ is
> empty.  I also didn't find any troff docs at the Unix Historical Society.

I saw this as well, I looked over the groff docs a bit but in the end just
stole stuff fron other man pages and the mdoc page.

> My so-called tool emits (what I assume is) straight troff input in
> addition to man macros:
>
> 	.SH SYNOPSIS
> 	.nf
> 	.fam C
>
> 	\fBfreebcp\fP ...
>
> But I can't adjust its output because I'm not a native troff speaker, nor
> a troff book buyer.

I guess I'd just throw out the SYNOPSIS stanza and rob one from something
that's close then hack it up.

> I got on this road because someone sent me a pseudo-man page in plain
> text, and txt2man seemed just the ticket, rather than marking it up
> myself.  And it almost was.

Marking one up really isn't that bad IMO as long as you steal a lot of your
ideas from existing man pages.

HTH

pjr