-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRUNME.R
38 lines (28 loc) · 834 Bytes
/
RUNME.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Load utility R functions ----
list.files(path = "R", full.names = TRUE) |>
purrr::walk(source)
# Create package pages ----
here::here("packages") |>
list.dirs() |>
setdiff(here::here("packages")) |>
unlink(recursive = TRUE)
packages <- here::here("_packages.yml") |>
yaml::read_yaml() |>
purrr::pluck("packages") |>
lapply(get_package) |>
lapply(\(x) purrr::discard(.x = x, .p = is.null))
pkg_template <- here::here("packages/template.qmd") |>
readLines()
for (pkg in packages) {
out <- pkg |>
with(glue::glue("packages/{repo$name}/index.qmd")) |>
here::here()
dir.create(dirname(out))
pkg_template |>
whisker::whisker.render(data = pkg, strict = FALSE) |>
writeLines(out)
}
# Create hex sticker wall on the front page ----
packages |>
hexgrid() |>
writeLines("www/hex.html")