Files
su2026rwep/RP/index.qmd
T
2025-12-14 16:46:17 +08:00

43 lines
742 B
Plaintext

---
subtitle: "Reports"
author: ""
execute:
freeze: false
---
```{r}
#| output: asis
data.frame(fd = dir(".", pattern = "\\d{4}[-_]")) |>
dplyr::mutate(
fn = purrr::map_chr(
fd,
~ file.path(.x, dir(.x, pattern = "index.qmd|index.html"))[1]
)
) |>
dplyr::transmute(
htmlstr = purrr::map2_chr(
fn,
fd,
~ paste0(
"## [",
.y,
"](",
.x,
")\n\n",
ifelse(
!grepl("qmd$", .x),
"",
paste0(
"{{< pdf ",
gsub("qmd$", "pdf", .x),
" width=400 height=510 button=\"Download\" >}}\n\n"
)
)
)
)
) |>
dplyr::pull(htmlstr) |>
paste(collapse = "") |>
cat()
```