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

R6 links to documentation for inherited methods not compatible with 'pkgdown' #1173

Closed
coolbutuseless opened this issue Oct 5, 2019 · 7 comments · Fixed by #1722
Closed
Labels
feature a feature request or enhancement linking 📎

Comments

@coolbutuseless
Copy link

When the documentation pages are generated in 'pkgdown' the links to the superclass methods in the "Inherited methods" section don't work.

For example: Try any of the 'inherited methods' links on this page:
https://coolbutuseless.github.io/package/minihtml/reference/HTMLDocument.html

The URL for the documentation is https://coolbutuseless.github.io/package/minihtml/html/HTMLElement.html#method-as_character_inner when it probably should be https://coolbutuseless.github.io/package/minihtml/reference/HTMLElement.html#method-as_character_inner

I think it has to do with the use of the relative path link for inherted methods i.e. \item \href{../../minihtml/html/HTMLElement.html#method-as_character_inner}{\code{minihtml::HTMLElement$as_character_inner()}}

Not sure if this is really a roxygen2 issue, or if it's something pkgdown should be translating during the build process.

@gaborcsardi
Copy link
Member

Yeah, I think we need to work out what to do in this case. I am afraid that we need to make pkgdown smarter about these links. CC @hadley

@hadley
Copy link
Member

hadley commented Oct 5, 2019

This is the flaw of hacking in the links. Maybe roxygen2 should add a class attribute to the link so that pkgdown knows to handle them specially?

@gaborcsardi
Copy link
Member

@hadley Yeah, that's what I was thinking. May it can add a class, plus a data attribute that contains the name of the package, class and method, and then pkgdown can handle it nicely.

@hadley
Copy link
Member

hadley commented Oct 5, 2019

Sure, although it's also easy enough to parse that data from the url.

gaborcsardi referenced this issue in r-lib/roxygen2 Oct 5, 2019
These currently happen when linking to inherited R6
methods.

Closes (the roxygen part of) #933.
gaborcsardi referenced this issue in r-lib/roxygen2 Oct 6, 2019
These currently happen when linking to inherited R6
methods.

Closes (the roxygen part of) #933.
@gaborcsardi
Copy link
Member

With r-lib/roxygen2#936 merged roxygen2 now adds information that pkgdown can parse and then create the right links.

@hadley hadley transferred this issue from r-lib/roxygen2 Nov 5, 2019
@hadley
Copy link
Member

hadley commented Nov 5, 2019

Transferred to pkgdown

@hadley hadley added feature a feature request or enhancement linking 📎 labels Mar 10, 2020
@hadley
Copy link
Member

hadley commented Mar 11, 2020

Would someone mind generating a minimal R6 class that I illustrates this problem that I could include in pkgdown as regression test?

hadley added a commit that referenced this issue Oct 6, 2021
Fixes #1173

Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement linking 📎
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants