-
Notifications
You must be signed in to change notification settings - Fork 235
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
Resolve markdown links to external packages #1633
Conversation
We cannot refer to non-exixtant functions even conditionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me in duckdb, thank you for the very quick fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super-minor stuff.
Next level: automatically add these qualifications with @inheritParams
-- I have this in DBI, and I see how niche this probably is.
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
Should not be needed. But we still error for a name clash between a base and non-base package.
So we don't parse DESCRIPTION for every link.
You mean adjusting the link target packages in Rd from |
This might work, I have only tried with |
It changes things in tibble, trying in CI/CD now: https://github.com/tidyverse/tibble/actions/runs/9871752503 Thank you very much! |
Works for tibble, green builds again! |
So, I have been using this for a bit, and it does not work very well when you are adding new functions that are not documented yet, or refactoring a package and renaming functions. The errors don't allow the changes to propagate properly. One solution would be to have a warning instead of an error. This is easy to implement. The caveat is that you might end up with incorrect links, unless you run Another solution is to delay the resolution of the link target packages until the (new) topic of the documented package are known. This might be difficult to implement with how roxygen2 works currently. We would essentially need to do the final link fixup in the generated Rd docs. |
To better understand this: the problem is that this PR works worse than the main branch if documentation is added to a function that didn't have documentation before? What errors are you seeing? |
I think switching to warnings are probably a good start. Can we assume that if we can't find the topic it's in the current package? |
Good idea. R CMD check will catch the real errors anyway. |
@krlmlr Yeah, when you are refactoring or developing, you might have a state where you are referring to a function that is not documented. E.g. if you simply rename a function that you are cross-linking from a manual page. With this PR the package of the renamed function cannot be resolved, which causes an error, and the manual pages are not updated. So you are stuck in this state. |
Otherwise renaming functions is impossible. (Well, very cumbersome.) Cf. #1633 (comment)
@hadley OK, I turned them into warnings. Can you please take another look? |
Also need an early return from name clashes. Now that we don't error we need to return explicitly.
Great, this worked for all cases I tried! |
Anchor links to base packages as well.Closes #1612.