r-lib / pkgdown

Generate static html documentation for an R package

Home Page:https://pkgdown.r-lib.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pkgdown doesn't respect `df_print: paged`

dvg-p4 opened this issue · comments

This is incredibly inconvenient when trying to, well, create a documentation site that looks nice.

What is df_print: paged?

Unfortunately I think that's going to be hard to support because it requires additional CSS and JS to be added to the page, which is pretty fiddly. However, I think you'll be able to get something pretty close by using reactable; that should already be supported through the existing support for html widgets.

Yeah, I did some fiddling around in a fork, got it to ~90% work, but the CSS involved was pretty hacky (and may have been subtly messing up other formatting.) Thanks for the pointer to reactable!

@hadley is there any way to get all data.frame output to automatically render as reactable tables (rather than having to manually call reactable() around every output) when building with pkgdown?

If you can add a custom class, you could also provide pkgdown_print method. Otherwise I don't know of a way.

I'm trying defining pkgdown_print.data.frame <- function(x) {reactable::reactable(x)} but it doesn't seem to be working--perhaps I'm not understanding how pkgdown_print is supposed to be used? (There doesn't seem to be much documentation on it.)

Oh I see, that's only used for rendering example output in function docs, not for vignettes.