Follow-up Comment #5, bug#61434 (group groff): Hi Deri,
[comment #4 comment #4:] > [comment #3 comment #3:] > > This was an important follow-up commit. > > commit 52a5a89c0da9f90c83441b8eb8020344a8468686 > > Author: G. Branden Robinson <g.branden.robin...@gmail.com> > > Date: Thu Feb 1 23:23:45 2024 -0600 > > > ... > > Unfortunately, "pdf.tmac" doesn't > > expose a clean abstraction for "link starts here" and "link stops here", > > instead implementing a hugely featured `pdfhref` macro that attempts to > > do everything--except support bracketing the link text in a diversion, > > which our man(7) design requires. > Is this accurate? To the best of my knowledge, yes. [https://git.savannah.gnu.org/cgit/groff.git/commit/?id=dc265728eee39db3bf5e2f3b09f8f124880f8f05 The GNU MT/ME and UR/UE extensions date back to 2007]; MR is much more recent, and the design of the last is deliberately closely modeled on plan9port's macro (originally named `IM`, I think, but they renamed it to `MR` at my request), which in turn looks very much like the `BR` and `IR` calls people have been writing for man page cross references forever. So the fact that `MR` is in the shape that the `pdfhref` approach expects is largely a happy coincidence. But it also makes sense for the other foregoing macros to work as _they_ do. The link text of `MR` won't sprawl due to its nature, whereas someone might want to hyperlink an arbitrary run of text to a URL or an email address. [https://git.savannah.gnu.org/cgit/groff.git/commit/contrib/pdfmark/pdfmark.tmac?id=f9503b9746b93a624339d488ebb29b77a4fbf667 That `pdfhref` didn't anticipate this in 2004 is unfortunate.] > It was true before my commit d71f9264 which enabled .MT and .UR to be hyperlinks (both of which used diversions) and provided a means to "bracket" the resulting text as a hotspot. Maybe the mechanism of using the pipe character to "open" the bracket needs further promulgation, ...I'm a little uneasy with that, in part because it constitutes in-band signaling. What if a document author wants to hyperlink a pipe sign? This is unlikely in conventional prose, but what if someone has a table of punctuation glyphs, like an ASCII code chart? Maybe each cell in the grid could hyperlink to (a section of) a document explaining the history of the code point. > or perhaps we should add a pair of macros to pdf.tmac, something like:- > .de pdflinkstart > . ds pdf:col \\n[.m] > . pdfhref \\$1 -D \\$2 "|" > .. > . > .de pdflinkend > . nop \X'pdf: markend'\m[\\*[pdf:col]]\c > .. > Which could be used as:- > .pdflinkstart W http://bbc.co.uk > .nf > A multi > line hotlink (possibly from a diversion) > .fi > .pdflinkend > Just a thought. I like this much better, but you might go further and have "pdflinkstart" employ a "markstart" command so that you don't have to impute special meaning to "|". I think this aspect of the pdfmark API constitutes technical debt (from a contributor who declines to work with us any longer, moreover) and I encourage you to develop your own ideas for _groff_ support of PDF features. Best regards, Branden _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?61434> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/