update index.qmd

This commit is contained in:
2025-11-27 16:28:33 +08:00
parent 304c78ebbf
commit 4741b2b22d
4 changed files with 178 additions and 25 deletions
+12 -15
View File
@@ -1,43 +1,40 @@
---
subtitle: "演示材料"
subtitle: "Slides"
---
```{r}
#| echo: false
#| output: asis
#| echo: false
data.frame(fd = dir(".", pattern = "\\d{4}[-_]")) |>
dplyr::mutate(
fn = purrr::map_chr(
fd,
~ file.path(
.x,
dir(.x, pattern = "index.qmd|index.doc|index.pdf|index.ppt")
)
~ file.path(.x, dir(.x, pattern = "index.qmd|index.html|index.ppt*"))[1]
)
) |>
dplyr::transmute(
htmlstr = purrr::map_chr(
fn,
~ paste0(
htmlstr = purrr::map2_chr(fn, fd, \(x, y) {
paste0(
"## [",
.x,
y,
"](",
.x,
x,
")\n\n",
ifelse(
!grepl("qmd$", .x),
!grepl("qmd$", x),
"",
paste0(
"<iframe title='",
gsub("^.*[_-]([^\\/]*)\\/.*$", "\\1", .x),
gsub("^.*[_-]([^\\/]*)\\/.*$", "\\1", x),
"' width=800 height=600 src = '",
gsub("qmd$", "html", .x),
gsub("qmd$", "html", x),
"'></iframe>\n\n"
)
)
)
)
})
) |>
dplyr::pull(htmlstr) |>
paste(collapse = "") |>