This commit is contained in:
2023-11-10 13:58:58 +08:00
parent 4c17581235
commit 68b3c6dc7f
26 changed files with 6166 additions and 19 deletions
+1 -7
View File
@@ -17,13 +17,7 @@ rmdify::rmd_init()
data.frame(fd = dir(".", pattern = "[-_]")) |>
dplyr::mutate(fn = purrr::map_chr(fd, ~ file.path(.x, dir(.x,
pattern = "index.qmd|index.doc|index.pdf|index.ppt")))) |>
dplyr::transmute(htmlstr = purrr::map_chr(fn, ~ paste0("## [", .x, "](", .x, ")\n\n",
ifelse(!grepl("qmd$", .x), "",
paste0("<iframe title='",
gsub("^.*[_-]([^\\/]*)\\/.*$", "\\1", .x),
"' width=800 height=600 src = '",
gsub("qmd$", "html", .x),
"'></iframe>\n\n"))))) |>
dplyr::transmute(htmlstr = purrr::map_chr(fn, ~ paste0("## [", .x, "](", .x, ")\n\n"))) |>
dplyr::pull(htmlstr) |>
paste(collapse = "") |>
cat()