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

autolinking and rdname #1576

Closed
maelle opened this issue Mar 15, 2021 · 7 comments · Fixed by #1586
Closed

autolinking and rdname #1576

maelle opened this issue Mar 15, 2021 · 7 comments · Fixed by #1586
Labels
bug an unexpected problem or unintended behavior

Comments

@maelle
Copy link
Collaborator

maelle commented Mar 15, 2021

r-lib/usethis#1392

@maelle maelle added the bug an unexpected problem or unintended behavior label Mar 15, 2021
@maelle
Copy link
Collaborator Author

maelle commented Mar 15, 2021

probably a tweak needed in package.R

@maelle
Copy link
Collaborator Author

maelle commented Mar 17, 2021

If I replace the line below (in package_topics())

name = names,

with

name = fs::path_ext_remove(file_out)

cf #1577

I get the correct link.

Now, I am not too sure I have not broken other things.

In any case it seems the topic index is not exactly what it should be for downlit to produce the correct link.

If I look at the pkg$topics for usethis, "tidyverse.Rd" is the only Rd for which the name and filename are different. usethis uses @name bla to create bla.Rd, and in most cases the other things described with @rdname bla come after that and in the same file, whereas things described with @rdname tidyverse come in other files.

@maelle
Copy link
Collaborator Author

maelle commented Mar 17, 2021

I am also wondering if it's an unexpected behavior of roxygen2?

\name{use_tidy_github_actions}
\alias{use_tidy_github_actions}
\alias{tidyverse}

wouldn't one expect tidyverse to be the name, after all?

@hadley
Copy link
Member

hadley commented Mar 19, 2021

It seems like something should be using fileout rather than name? Agreed, that this also looks like a weirdness in roxygen2.

@maelle
Copy link
Collaborator Author

maelle commented Mar 19, 2021

that's what I implemented in #1577 but I was wondering whether it'd break other things.

I had opened an issue in roxygen2 as well.

@dmurdoch
Copy link
Contributor

I believe the \name{} field is displayed in the top left of the standard help page display. It's also used to sort the entries in the PDF manual (which is why the lattice package has such weird names). I think this is a bad design, but failed to change it when I tried a few years ago.

I'm pretty sure your patch or mine would be safe here.

@dmurdoch
Copy link
Contributor

One difference between yours and mine: I think yours makes bigger changes, in that it changes the name field, whereas mine ignores it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants