33 lines
773 B
Plaintext
33 lines
773 B
Plaintext
|
---
|
||
|
subtitle: "课件"
|
||
|
---
|
||
|
|
||
|
```{r}
|
||
|
#| include: false
|
||
|
require(drwateR)
|
||
|
require(rmdify)
|
||
|
rmdify::rmd_init()
|
||
|
knitr::opts_chunk$set(echo = TRUE)
|
||
|
```
|
||
|
|
||
|
```{r}
|
||
|
#| output: asis
|
||
|
#| echo: false
|
||
|
#| message: false
|
||
|
|
||
|
data.frame(fd = dir(".", pattern = "[-_]")) |>
|
||
|
dplyr::filter(!grepl("_files", fd)) |>
|
||
|
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("<iframe title='",
|
||
|
gsub("^.*[_-]([^\\/]*)\\/.*$", "\\1", .x),
|
||
|
"' width=800 height=600 src = '",
|
||
|
gsub("qmd$", "html", .x),
|
||
|
"'></iframe>\n\n"))))) |>
|
||
|
dplyr::pull(htmlstr) |>
|
||
|
paste(collapse = "") |>
|
||
|
cat()
|
||
|
```
|