Open maelle opened 4 years ago
For packages that are already on CRAN / BIOC, this information already exists one click away (i.e., the link under "Download from CRAN at").
Right! Which makes the feature less useful. However even for those, the dependencies page could look better than the CRAN page: ordering dependencies alphabetically, one line per dependency (to make it easier to count them?), and linking to their pkgdown website when existing instead of their CRAN page. :slightly_smiling_face:
We could dump desc::desc()
output to a flat file and annotated with appropriate links.
I'm not sure where to link to this. A badge doesn't seem appropriate.
Right, I was thinking it was slightly related to "dev" hence the idea to put it under "Dev status". :grin: (the navbar seems too prominent for such a link?)
The dependencies list could make it clear what's on CRAN/what's not and it'd be nice if it merged Remotes with other fields (e.g. if the package imports pkgdown and has r-lib/remotes@vtag in Remotes). The page source could be a direct link to DESCRIPTION on GitHub (like what happens for vignettes/manual pages).
Maybe this could be based on sessioninfo::session_info("pkgdown")
— that way it also serves as a record of exactly which versions were used to build the site.
Wanted to bump this idea. It would be quite nice to have something like the below under Developers
or Dev status
. Alternatively, if it can't be built out into pkgdown, could the sidebar be customizable such that one could add it if they so desired?
I was thinking to dump sessioninfo::session_info("pkgdown")
output to a new page (build-session.html) that is linked in the pkgdown site footer, changing "built" to a link in "Site built by pkgdown 2.0.8".
I think that the right place to add this is under links, since it seems most related to "browse source code" and "report a bug", now that dev status is only display on the development site.
But I'm not sure about the visual treatment on the page itself. We could copy CRAN and do a comma separated list, but that seems like not a lot of content for the whole page. We could do a table but I think there are only two obvious columns: the package name (linked to the website) and the dependency type. I think @JosiahParry's suggesting of bulleted lists is the most compelling, but that's going to create a pretty long page that's fairly low information density. Is there something else that we could display on this page?
I've generally gone off the idea of also including the versions actually used to build the page since I don't think that's going to be that useful to that many people, but I could probably be convinced otherwise.
I did figure out one thing that we can do that CRAN does not, and that's list all the recursive dependencies.
I quite like your suggestions, @hadley, particularly the recursive dependencies. I often find myself using tools::package_dependencies("pkg", recursive = TRUE)
to get a fuller picture of what i'm importing.
Could the lengthy lists be hidden in a collapsable section somewhat like this?
repro:
@JosiahParry are you think that would go in the sidebar?
@hadley, yes, I think so. I could envision something like below but ~ prettier ~.
Gif hidden in details
Or, alternatively, I could envision a pkgdown page similar to CRAN's package (i.e. rlang) landing page that that has all the package metadata in one location. This would be go nicely well with a package level rd file (I'm thinking of usethis::use_package_doc()
). In this case there is more real estate to work with.
When checking out a package via its pkgdown homepage, I often click on the GitHub icon to go open DESCRIPTION and look at the package and external dependencies.
It'd be cool for pkgdown websites to feature a page listing dependencies (linking them like external functions, related to #1234).
The homepage could link to it somehow. Maybe a badge under "Dev status", before other badges, that'd have the text "dependencies".