New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Man writer: hyperlinks #9120
Comments
If these are groff-specific, that might be a reason to avoid them. |
I don't see these macros being used in the man pages on my system. I don't think we should use them. |
What is your system? Ubuntu 20.04, released in 2020, has number of man pages with
Ubuntu 14.04, released in 2014, has 58 man pages with I found NomadBSD, a FreeSBD-based OS. They provide Live image, so I was able to download and run it without installation. NomadBSD does not have man pages with
BTW, they man is not GNU one: NomadBSD's man does not accept
I think even if NomadBSD (read "FreeBSD") man recognizes
How NomadBSD renders links using less-than or more-than signs, as shown above. Linux renders them similar:
But uses Unicode angle brackets instead of less-than and more-than signs. However, rendering is not so important. More importantly that pandoc loses information when converting from markdown to man: in markdown we have link, in man we only have text, not a link. BTW, pandoc's man reader recognizes
You see, than converting from man to markdown correctly converts a link, but conversion in opposite direction does not. |
I think I was mistaken; there are some Anyway, I will reopen this for further comment, but the question is whether it is best practice for portable man pages to produce these groff-specific macros. Maybe @g-branden-robinson (who helped with some other man page issues) could weigh in on this? |
I'm curious to know what's issuing warnings and what they say. What provides your system's man command? I'm guessing either mandb or mandoc. Here's what I get for each implementation.
It appears to me that GNU grep is ensuring that it can use https://git.savannah.gnu.org/cgit/grep.git/tree/doc/grep.in.1?h=v3.11#n58 As extensions to the man macro language go,
I don't actually know that that many people use Heirloom behind a man pager, but figured I should include it for completeness. Can you tell me what sorts of factors would help you decide whether support for groff extensions is prevalent enough for pandoc to employ them? Regards, |
I get
The message:
I'm really not sure. If the man implementations commonly found on macOS, linux, and BSD systems can all handle these macros, then I think it should be fine? I didn't know if there were any standard guidelines for producing portable man pages. |
Hi John,
Huh. That doesn't look like man-db man or mandoc man. But today I learned there are several macOS users complaining about a change in Ventura (1, 2). The users say macOS's new man(1) is a shell script. So is FreeBSD's, so it may be that Apple adopted that one. Or forked it.
Yikes. That is not very helpful, and with respect to It might take some sleuthing to figure out what exactly about the page is provoking that diagnostic. The GNU grep(1) page does, as I implied before, do some fairly sophisticated things (conditional tests and definitions) that ultra-portable pages don't attempt.
There is no standard, and never has been. In the 6 years I've been working on groff I've added a lot of historical information to the groff_man(7) document to help people out with these matters. More importantly, in groff 1.23.0, the groff_man_style(7) page has a section on "Portability", to which Ingo Schwarze and I have given a lot of attention. So what I would do is read up about the macros documented in groff_man(7) as extensions, decide which formatters you want to support, and proceed from there. groff of course supports its own extensions, and mandoc supports them all except for the brand-new-to-1.23.0 Let me know if/how I can help here. Regards, |
Thanks - I decided to support them. |
See #9120. We need to use `\c` before a `.UR` or `.MT`, to avoid an extra space, and also after. To ensure that a space at the beginning of the following line doesn't get swallowed up, we escape it with `\`.
Currently man writer renders links as text:
There are special groff macros to format links:
.UR
/.UE
usage:Brackets denote optionality, punctuation will be written afther the link with no interleaving space.
BTW, there are similar macros for email links:
.MT
and.ME
. See more details in groff_man (search for "Hyperlink macros").It would be nice if man writer uses these groff macros.
The text was updated successfully, but these errors were encountered: