Skip to content
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

When resolving rmarkdown links to other packages, please do not anchor the link text. #1662

Open
krivit opened this issue Oct 1, 2024 · 2 comments

Comments

@krivit
Copy link

krivit commented Oct 1, 2024

Since #1633 was merged, the behaviour has been to expand [fun()] to \code{\link[pkg:fun]{pkg::fun()}}.

This is often unsightly and verbose and is not ideal when the link text refers to a class rather than its main constructor. For example, [`mcmc.list`] becomes \code{\link[coda:mcmc.list]{coda::mcmc.list}}.

I think it would be better if the link text were only anchored if the link is anchored. E.g.,

[fun()] -> \code{\link[pkg:fun]{fun()}}
[pkg::fun()] -> \code{\link[pkg:fun]{pkg::fun()}}

@krivit
Copy link
Author

krivit commented Oct 1, 2024

Further to this, package developers have relied on the old behaviour when writing their documentation: in those instances where we had intended to anchor the link text, we already have.

krivit added a commit to krivit/roxygen2 that referenced this issue Oct 1, 2024
… text unless the user has specified it explicitly

Closes r-lib#1662
@krivit
Copy link
Author

krivit commented Nov 10, 2024

Apologies for bumping this. I've forked roxygen2 and patched rmarkdown to do what I describe, and it solves the problem for me, but I would appreciate a response from the maintainers what the behaviour will be going forward. I apologise in advance if this is the wrong venue to raise this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant