On Tue, Mar 15, 2022 at 03:41:20PM +0000, yeti wrote:
On Tue, 2022-03-15 at 08:27 -0400, rjc@tilde.institute wrote:
Those who prefer viewing manual pages in a web browser need not seek further than mandoc(1), i.e.:
????????????????$ MANPAGER="lynx -force_html" man -T html institute
`w3mman` turns more stuff into links.
Actually, w3mman(1) seems to only support the Xr macro.
Either way, as-is, the above is only good for viewing a single manual as an HTML page in a web browser, should one prefer it - nothing more, nothing less.
It also has the benefit of not being tied to any particular web browser - it may as well be Firefox if used locally.
Given that the end result looks like this:
$ lynx -force_html /tmp/man.XXXXXXXXXX
it isn't immediately obvious whether it is at all possible to make lynx(1) or any other "stock" web browser for that matter (BTW, no, uzbl doesn't count), effectively, run an arbitrary command when following an anchor of the Xr class and using said anchor as the command's argument.
Either way, the hyperlinks *are* there and can be used and in order to benefit from all, both external and internal anchors, one can simply run the below:
$ lynx man.openbsd.org/OpenBSD-$(uname -r)/ifconfig.8
Last but not least, the above isn't limited to HTML - the same thing can be done if one prefers to view manual pages as PS, PDF, etc. - again, best done locally:
$ MANPAGER=mupdf man -Tpdf ifconfig
Again, an alias or a function recommended.
Cheers,
rjc