Hi Anthony!

Ok, I see your point.

However this is still somewhat of a nuisance. It is also fairly easy to find 
these problems using something like:
grep -rE '\\f(I|B)[a-z._-]+\\fR\([1-9]p?\)' /usr/share/man

Or if we are dealing with -T html output of man(1) then something like this 
would find these problems:
man -T html 8 unbound|grep -E '<(i|b)>[a-z._-]+</(i|b)>\([1-9]p?\)'

So it should be possible to automatically replace these with real links?
I’m not sure what would happen if the man(7) format files where modified (on 
the fly) to include .Xr syntax. But at the very least the mandoc(1) -T html 
command could be (optionally?) modified to change these to real links?

I have implemented this on a private web page for showing local man pages of 
the OpenBSD system and it seems to work fine.
The web page essentially calls man -T html -O fragment,man=<baseurl> <section> 
<query> and then it processes the output before displaying it in a <div>.

I have not yet figured out if it would be possible to preprocess the incoming 
man source file when using the man(1) command.

For https://man.openbsd.org/ to gain this functionality I would guess that man 
-T html would need to be modified?
-- 
Mike Fischer

> Am 06.03.2021 um 09:56 schrieb Anthony J. Bentley <[email protected]>:
> 
> [email protected] writes:
>> The aforementioned man pages use e.g. \fIunbound\fR(8) instead of
>> .Xr unbound 8. Instead of using font formatting options the
>> .Xr links should always be used to reference other man pages.
> 
> This is not a bug in OpenBSD.
> 
> There are two languages used to write OpenBSD manpages, mdoc(7) and
> man(7). mdoc(7) is the modern format used by most OpenBSD manuals.
> man(7) is a much older format and is used primarily by large external
> projects that we include in OpenBSD but are not the main source of.
> 
> .Xr is a mdoc(7) instruction that is not valid in a man(7) page.
> 
> Unbound is one of those large external projects whose documentation we
> import wholesale. We don't write those pages--NLnet does. So we can't
> control whether they use mdoc(7) or not.
> 
> It's possible to rewrite the pages. Such things have been done before;
> for example the LibreSSL manuals were converted from POD to mdoc(7).
> Upstream might be receptive to patches; then again, they may not. And
> it would be a lot of work.
> 
> -- 
> Anthony J. Bentley

Reply via email to