diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-11 10:14:57 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-11 11:48:49 -0600 |
commit | 93fd4f9f5899cc9d5a0bb9c4f71373a2c00d80c7 (patch) | |
tree | fcb4484ef9b318b9fad39cb0efcfde1182f7a4bc /tmac | |
parent | 69a63dc109ba741e5e036a1ce2edcd98b991c857 (diff) | |
download | groff-git-93fd4f9f5899cc9d5a0bb9c4f71373a2c00d80c7.tar.gz |
[man]: Make multiple URL formats available.
* tmac/an.tmac: Add internal register `an*MR-URL-format` to select from
a few known formats of man page hyperlink. There are three known on
macOS, and one used everywhere else.
* tmac/man.local: Document this feature so macOS users can enjoy the OSC
8 hyperlink feature if their terminal application supports it.
I hope that this feature will be a temporary measure while macOS
implements support for the man page URL format used everywhere else in
the world.
Fixes <https://savannah.gnu.org/bugs/?63768>. Thanks to John Gardner
for the report, research, consultation, and testing.
ANNOUNCE: Update bug counts.
Also wrap previous ChangeLog entry at 72 columns.
Diffstat (limited to 'tmac')
-rw-r--r-- | tmac/an.tmac | 19 | ||||
-rw-r--r-- | tmac/man.local | 10 |
2 files changed, 26 insertions, 3 deletions
diff --git a/tmac/an.tmac b/tmac/an.tmac index a00340573..7ab3ccae1 100644 --- a/tmac/an.tmac +++ b/tmac/an.tmac @@ -1,6 +1,6 @@ .\" groff implementation of man(7) package .\" -.\" Copyright (C) 1989-2022 Free Software Foundation, Inc. +.\" Copyright (C) 1989-2023 Free Software Foundation, Inc. .\" Written by James Clark (jjc@jclark.com) .\" Enhanced by: Werner Lemberg <wl@gnu.org> .\" Larry Kollar <kollar@alltel.net> @@ -1161,17 +1161,30 @@ contains unsupported escape sequence . rm an*prefix .. . +.\" There is no standardized format for man page URLs, but the default +.\" is expected to work (or be harmlessly ignored) everywhere except +.\" macOS. Override in man.local if desired. +.nr an*MR-URL-format 1 +. .\" Set a man page cross reference. .\" .MR page-topic page-section [trailing-text] .de1 MR . if ((\\n[.$] < 2) : (\\n[.$] > 3)) \ . an-style-warn .\\$0 expects 2 or 3 arguments, got \\n[.$] +. if (\\n[an*MR-URL-format] = 1) \ +. ds an*url man:\\$1(\\$2)\" used everywhere but macOS +. if (\\n[an*MR-URL-format] = 2) \ +. ds an*url man:\\$1.\\$2\" Bwana (macOS) +. if (\\n[an*MR-URL-format] = 3) \ +. ds an*url x-man-doc://\\$2/\\$1(\\$2)\" ManOpen (macOS) +. if (\\n[an*MR-URL-format] = 4) \ +. ds an*url x-man-page://\\$2/\\$1\" Terminal.app, iTerm (macOS) . nh . if \\n[an*do-hyperlink] \{\ . if \\n[an*is-output-html] \ -. nop \X^html:<a href="man:\\$1(\\$2)">^\c +. nop \X^html:<a href="\\*[an*url]">^\c . if \\n[an*is-output-terminal] \ -. nop \X^tty: link man:\\$1(\\$2)^\c +. nop \X^tty: link \\*[an*url]^\c . \} . nop \&\\*[an-lic]\f[\\*[MF]]\\$1\\*[an-ic]\f[R](\\$2)\c . if \\n[an*do-hyperlink] \{\ diff --git a/tmac/man.local b/tmac/man.local index ed5706b41..6b30900f6 100644 --- a/tmac/man.local +++ b/tmac/man.local @@ -14,6 +14,16 @@ .\" might prefer to remap it to bold ("B") instead. .\" .if n .ftr CW R .\" +.\" A de facto standard URL format for man pages is recognized +.\" everywhere except Apple, where different macOS applications expect +.\" different formats. +.\" 1: man:groff(1) -- package default +.\" 2: man:groff.1 -- Bwana (macOS) +.\" 3: x-man-doc://1/groff(1) -- ManOpen (macOS) +.\" 4: x-man-page://1/groff -- Terminal.app, iTerm (macOS) +.\" Set this register to configure which the `MR` macro uses. +.\" .nr an*MR-URL-format 1 +.\" .\" Local Variables: .\" mode: nroff .\" fill-column: 72 |