-
Notifications
You must be signed in to change notification settings - Fork 323
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
replay_html has problems when dealing with user defined S3 classes in @examples #677
Comments
If you require a reproducible example to play around with, you can clone https://github.com/s-fleck/dint. The package is small, simple and has no dependencies. |
I think there's a deeper problem because it should be |
Hmmmm, it works just fine for me. Can you please show me exactly what code you're running to build the package, and give me a |
(PS. I think it's bad practice to omit the generated |
When I filed the bug I was on a remote RStudio session at work. I tried it from home now and I am not able to reproduce the bug... I'll be at work again on Monday and try again there. weird... |
Apparently I changed something in the repository that fixed the issue between filing this bug and you checking it out. I could not figure out what that was, as I made few changes to the roxygen. The last commit where the error occured is: 3160e76a Here is the Traceback
I made a branch where I stripped down the package to just two functions where the bug still occurs: |
Hmm now I can't reproduce the bug for the commits I mentioned, but for some older commits it still exists. I am sorry, but it seems quite hard to pinpoint why and how this happens. Maybe this helps: For the cases where I am not sure what |
Closing for now. If the issue persists could you please build a minimal package that recreates the issue? |
I was not able to pinpoint the issue. It persisted in some version of the package but not in others, without any changes in between that had much to do with the roxygen. Maybe it was just a weird combination of several unfortunate circumstances. |
The problem occurred again to me today, after more than one year of not encountering the issue and for a different package. I am using the most recent github version of pkgdown (1.3.0.9100). I am not reopening the issue because I still can't produce a reprex.
The traceback is not really helpful:
Here is a direct link to the package at the commit that caused the problem: When I posted this comment originally, other people were not able to reproduce my problem with the package in question. For me at least the problem persists across two different systems (both ubuntu, one with R 3.5.2 and one with R 3.6.0). |
Okay this is super weird: I did the following steps:
The problem disappeared. It does not reappear if I remove the format method again and/or remove the function from pkgdown.yaml, even if I delete |
Thanks @s-fleck, adding a |
I was having this same problem with my package |
I had the same issue as described here on some very customized S3-classed. For me @ngreifer simple suggestion did the trick. I'm very puzzled why that works :) However, to spell it out, a corrected print method could look like this:
|
Adding `invisible()` helps resolve errors related to print method. See: r-lib/pkgdown#677
It is a bit hard for me to provide a reprex, but I will try to describe the problem as accurately as possible.
It seems rather simple anyways.
I am working on a package that deals with year-quarter dates. I have a roxygen block like this, where
date_y()
is a constructor for a custom s3 class for years:If I run pkgdown::build_site (dev version, ‘1.0.0.9000’) I get:
I do have proper
format()
andprint()
methods defined fordate_y
Objects. The problem described above does not occur if I change my @example to:I havent looked to much in the internals of pkgdown, but maybe it makes sense to define a
replay_html.default()
likereplay_html.character(format(x))
orreplay_html.character(capture.output(print(x)))
?The text was updated successfully, but these errors were encountered: