[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Converting man pages to PDF and links
From: |
Larry Kollar |
Subject: |
Re: [Groff] Converting man pages to PDF and links |
Date: |
Sun, 2 Dec 2007 22:08:21 -0500 |
Keith Marshall wrote:
.... I'd guess if you're viewing
file:///home/andre/man/man3/malloc.pdf
and it has a link to ../man1/vgrind.pdf then that would work?
Yep. `.pdfhref L -F path/to/vgrind.pdf -- "text for link hot spot"'
The "fun" starts if you want to make this at all general. A quick
grep through the manpages on my system turns up a number of ways to
format references to other pages:
.IR foo (1)
.BR bar (1)
\fBfoor\fR(1) (manual formatting, sloppy)
baz(1) (no highlighting, argh!)
.Xr quux 1 (BSD)
Since you're doing this for your own manpages, you can define a cross-
ref macro to include in each manpage:
.ds PDFpath path/to/
.\" Usage: Xref name vol trailing
.de Xref
.ie d pdfmark .pdfhref L -F \\*[PDFpath]\\$1.pdf -- "\fB\\$1\fP(\\$2)\
\$3"
.el .nop \fB\\$1\fP(\\$2)\\$3
..
Note that I haven't tested the above, but it should be pretty close
to workable.
-- Larry