r-lib / rprojroot

Finding files in project subdirectories
https://rprojroot.r-lib.org/
Other
149 stars 23 forks source link

add `is_pkgdown_project` root criterion #79

Closed salim-b closed 2 years ago

salim-b commented 3 years ago

looking for a _pkgdown.yml, _pkgdown.yaml, pkgdown/_pkgdown.yml and/or inst/_pkgdown.yml file

krlmlr commented 3 years ago

Thanks! I'll pick it up when I next work on rprojroot/here.

jennybc commented 3 years ago

What's the scenario where the above makes something recognizably a project and no other existing criterion does?

Am I just failing to see a usage pattern that I happen not to share?

salim-b commented 3 years ago

@jennybc I'd simply like to have a standardized way to check if a specific directory is set up for pkgdown. I could use it e.g. as follows:

is_pkgdown_dir <- function(path = ".") {
  rprojroot::is_pkgdown_project$testfun %>%
      purrr::map_lgl(~ .x(path = path)) %>%
      any()
}
salim-b commented 2 years ago

Hey @krlmlr, any update on this?

krlmlr commented 2 years ago

Thanks!