On 29/05/2026 13:41, G. Branden Robinson wrote:
Hi Pádraig,
At 2026-05-29T13:24:47+0100, Pádraig Brady wrote:
On 29/05/2026 11:05, G. Branden Robinson wrote:
Holy cow! I of course appreciate usage of the support for OSC 8
hyperlinks that I slaved over to get into grotty(1) for groff 1.23
(July 2023), but this is an unnecessarily hard-core way to achieve
what you're doing, and moreover deprives users of groff's HTML and
PDF output from enjoying the convenience of the hyperlink.
Could groff be adjusted so that it supports these tty links in html
output?
I'm...not sure what that would look like. When groff produces HTML, the
links become idiomatic `<a href=...>` elements. This has been the style
of groff's output for something like 25 years.
$ groff -man -T html /tmp/salad.man | sed -n '/Baz/,$p'
<p style="margin-left:6%; margin-top: 1em">Baz.</p>
<p style="margin-left:6%; margin-top: 1em">A
<a
href="https://www.gnu.org/software/coreutils/manual/html_node/Numeric-Modes.html"><b>numeric
mode</b></a> is from one to four octal digits (0-7), derived
by adding up the bits with values 4, 2, and 1. Omitted
digits are assumed to be leading zeros.</p>
<hr>
</body>
</html>
What are your expectations of groff's HTML output in this area?
The same output would be fine.
Note the arch linux man pages support these formats it seems:
https://man.archlinux.org/man/tee.1
and that mentions that mandoc is used.
Yes. mandoc(1) supports groff man(7)'s ~17 year old `UR`/`UE`/`MT`/`ME`
extensions.
Here's what it produces given the same input as my groff HTML output
example above.
$ mandoc -man -T html /tmp/salad.man | sed -n '/Baz/,$p'
<p class="Pp">Baz.</p>
<p class="Pp">A
<a class="Lk"
href="https://www.gnu.org/software/coreutils/manual/html_node/Numeric-Modes.html"><b>numeric
mode</b></a> is from one to four octal digits (0-7), derived by adding up
the bits with values 4, 2, and 1. Omitted digits are assumed to be leading
zeros.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">2026-05-29</td>
<td class="foot-os">groff test suite</td>
</tr>
</table>
</body>
</html>
Can you help me understand your request better?
May I propose the following alternative?
A
.UR https://\:www\:.gnu\:.org/\:software/\:coreutils/\:manual/\
\:html_node/\:Numeric\-Modes\:.html
.B "numeric mode"
.UE
is from one to four octal digits (0\-7), derived by
Yes the most abstract the better, however
the issue with that is it displays the URL.
That gets messy fast.
It can. The URL is not displayed if the output device is capable of
hyperlinking, unless there is no link text (a boldface "numeric mode" in
this case).
Illustration:
$ nroff -r LL=72n -man /tmp/salad.man | sed -n '/Baz/,$p'
Baz.
A numeric mode is from one to four octal digits (0-7), derived by
adding up the bits with values 4, 2, and 1. Omitted digits are as‐
sumed to be leading zeros.
This doesn't work for me.
groff/nroff 1.23 always display the URL when outputting to terminal here?
As does the default `man` invocation on Fedora 44 at least.
I must be missing something fundamental in all this.
cheers,
Padraig