converting an mdoc manual page into an old man format

Rich Morin rdm at cfcl.com
Sat Aug 12 05:25:42 UTC 2006


At 8:28 PM -0400 8/11/06, Mikhail Teterin wrote:
> I've written a man-page using mdoc macros for my own
> little program.
>
> I'd like to port the program to other Unixes (like
> Solaris), where my mdoc-based man page is rather
> unreadable :-(
>
> Is there a standard way to expand the mdoc macros once?
>
> `man mdoc' is not giving any useful examples -- I can
> create a PostScript or an HTML document, but I can't
> render it in the traditional man :-(

That's a really interesting question.

I would have thought that groff would have a cpp-like option
to just emit raw troff codes.  These wouldn't be pretty, but
they should be digestible by most troff implementations.  I
don't see such an option, however.

You could, of course go into troff and try to add such an
option, but that could range from trivial to impossible,
depending on the program's design.

Unless someone has written a special-purpose tool, I doubt
that you're going to be able to get from mdoc to man format.
And, although something like m4 could probably be convinced
to do the transformation, coding the macros would not be a
task for the timid.

-r
-- 
http://www.cfcl.com/rdm            Rich Morin
http://www.cfcl.com/rdm/resume     rdm at cfcl.com
http://www.cfcl.com/rdm/weblog     +1 650-873-7841

Technical editing and writing, programming, and web development



More information about the freebsd-doc mailing list