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

Add a dependencies page one click away from the homepage? #1333

Open
maelle opened this issue May 27, 2020 · 11 comments · May be fixed by #2520
Open

Add a dependencies page one click away from the homepage? #1333

maelle opened this issue May 27, 2020 · 11 comments · May be fixed by #2520
Labels
feature a feature request or enhancement home 🏠

Comments

@maelle
Copy link
Collaborator

maelle commented May 27, 2020

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".

@jayhesselberth
Copy link
Collaborator

For packages that are already on CRAN / BIOC, this information already exists one click away (i.e., the link under "Download from CRAN at").

@maelle
Copy link
Collaborator Author

maelle commented May 30, 2020

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. 🙂

@jayhesselberth
Copy link
Collaborator

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.

@maelle
Copy link
Collaborator Author

maelle commented Jun 2, 2020

Right, I was thinking it was slightly related to "dev" hence the idea to put it under "Dev status". 😁 (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).

@hadley hadley added feature a feature request or enhancement home 🏠 labels Aug 20, 2020
@hadley
Copy link
Member

hadley commented Oct 12, 2021

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.

@JosiahParry
Copy link

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?

Dependencies

Imports

  • rlang
  • httr2

Suggests

  • purrr

@jayhesselberth
Copy link
Collaborator

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".

@hadley
Copy link
Member

hadley commented May 8, 2024

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.

@hadley hadley linked a pull request May 8, 2024 that will close this issue
@JosiahParry
Copy link

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?

Screen Recording 2024-05-08 at 10 34 22

repro:

library(bslib)
library(shiny)

accordion(
  accordion_panel("Dependencies", accordion(
    list(
      accordion_panel(
        "Imports",
        tags$ul(tags$li("rlang"), tags$li("vctrs"))
      ),
      accordion_panel(
        "Suggests",
        tags$ul(tags$li("data.table"))
      ),
      accordion_panel(
        "Strong Recursive Dependencies",
        tags$ul(
          tags$li("httr2"),
          tags$li("Rcpp"),
          tags$li("cpp11"),
          tags$li("stringr")
        )
      )
    )
  ))  
)

@hadley
Copy link
Member

hadley commented May 8, 2024

@JosiahParry are you think that would go in the sidebar?

@JosiahParry
Copy link

JosiahParry commented May 8, 2024

@hadley, yes, I think so. I could envision something like below but ~ prettier ~.

Gif hidden in details

Screen Recording 2024-05-08 at 13 17 50

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.

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 home 🏠
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants