I think that the current behaviour is documented in WRE:

"...There are two other forms of optional argument specified as \link[pkg]{foo} 
and
\link[pkg:bar]{foo} to link to the package pkg, to files foo.html and bar.html 
respectively.
These are rarely needed, perhaps to refer to not-yet-installed packages (but 
there the HTML
help system will resolve the link at run time) or in the normally undesirable 
event that more
than one package offers help on a topic7 (in which case the present package has 
precedence so
this is only needed to refer to other packages). They are currently only used 
in HTML help
(and ignored for hyperlinks in LATEX conversions of help pages), and link to 
the file rather
than the topic (since there is no way to know which topics are in which files 
in an uninstalled
package) ...   Because they have been frequently misused, the HTML help system 
looks for topic foo in package pkg 
if it does not find file foo.html."

Unless I am missing something, it seems that it would be relatively painless to 
reverse the logic of the current behaviour of the help system,
i.e. to start looking first for the topic and then for a file.

Georgi Boshnakov

-----Original Message-----
From: R-package-devel <r-package-devel-boun...@r-project.org> On Behalf Of 
Gábor Csárdi
Sent: 16 June 2020 13:44
To: Duncan Murdoch <murdoch.dun...@gmail.com>
Cc: List r-package-devel <r-package-devel@r-project.org>
Subject: Re: [R-pkg-devel] check cross-references error: Non-file 
package-anchored link(s)

On Mon, Jun 15, 2020 at 5:30 PM Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
>
> On 15/06/2020 12:05 p.m., Martin Maechler wrote:
> >>>>>> Duncan Murdoch   on Sun, 14 Jun 2020 07:28:03 -0400 writes:
> >
> >      > I agree with almost everything you wrote, except one thing:  this 
> > isn't
> >      > newly enforced, it has been enforced since the help system began.  
> > What
> >      > I think is new is that there are now tests for it.  Previously those
> >      > links just wouldn't work.
> >
> >      > Duncan Murdoch
> >
> > Yes, to all... including Duncan's agreement with Gábor.
> >
> > Also, Duncan M earlier did mention that he had wanted to
> > *change* the link-to-file behavior for these cases (when he wrote 
> > most of the Rd2html source code) but somehow did not get it.
>
> Actually, I don't think I pushed for this change at the time (or at 
> least I didn't push much).  I just wish now that I had, because I 
> think it will be harder to do it now than it would have been then.
>
> Duncan

I am not entirely sure, but maybe just documenting the current behaviour and 
undoing 78674 could work. With some tweaks? E.g.

* updating R-exts to say that \link[pkg:topic]{text} will link to `topic.html` 
in `pkg` first (for historical reasons), and falls back to searching for 
`topic` in `pkg` at render time.
* updating Rd2HTML to look for the topic and use it in the link, instead of 
throwing a warning, in it cannot find `topic.html`
* removing the `R CMD check` warning for non-file links, that was added in 
78674 :)

Is there anything else?

Gabor

[...]

______________________________________________
R-package-devel@r-project.org mailing list 
https://stat.ethz.ch/mailman/listinfo/r-package-devel
______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to