update template to adapt new drwater extensions

This commit is contained in:
2025-07-28 21:09:10 +08:00
parent e3a53e3177
commit c419bb7fda
64 changed files with 714 additions and 44873 deletions
+1
View File
@@ -0,0 +1 @@
../../_extensions
+2 -1
View File
@@ -1,5 +1,6 @@
---
title: "文章讨论"
format: revealjs
author: "AUTHOR"
format: dwsd-revealjs
---
Binary file not shown.
+32 -9
View File
@@ -12,15 +12,38 @@ rmdify::rmd_init()
```{r}
#| output: asis
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::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::pull(htmlstr) |>
paste(collapse = "") |>
cat()