render compile
This commit is contained in:
@@ -1,41 +1,22 @@
|
||||
---
|
||||
subtitle: "Abstract"
|
||||
subtitle: "课程简介"
|
||||
author: ""
|
||||
---
|
||||
|
||||
```{r}
|
||||
#| out-width: 80%
|
||||
fig <- dwfun::ggsavep("./figures/GA.pdf", loadit = TRUE)
|
||||
if (!is.null(fig)) fig
|
||||
```
|
||||
|
||||
```{r}
|
||||
#| output: asis
|
||||
# function
|
||||
extract_abstract <- function(file) {
|
||||
content <- readLines(file, warn = FALSE)
|
||||
abstract_line <- grep("^# Abstract[^:]", content, ignore.case = TRUE)[1]
|
||||
if (length(abstract_line) == 0) return(NA)
|
||||
start <- abstract_line + 1
|
||||
while (start <= length(content) && trimws(content[start]) == "") {
|
||||
start <- start + 1
|
||||
}
|
||||
if (start > length(content)) return(NA)
|
||||
end <- start
|
||||
while (
|
||||
end <= length(content) &&
|
||||
trimws(content[end]) != "" &&
|
||||
!grepl("^#", content[end])
|
||||
) {
|
||||
end <- end + 1
|
||||
}
|
||||
paste(content[start:(end - 1)], collapse = " ")
|
||||
}
|
||||
# extract
|
||||
file <- "./MS/MS.qmd"
|
||||
abstract <- rmarkdown::yaml_front_matter(file)$abstract
|
||||
if (is.null(abstract)) {
|
||||
abstract <- extract_abstract(file)
|
||||
}
|
||||
cat(abstract)
|
||||
```
|
||||
# 基本信息
|
||||
|
||||
- 课程名称:区域水环境污染数据分析实践<br>Data analysis practice of regional water environment pollution
|
||||
- 授课教师:王为东、苏命
|
||||
- 课程教室:教二楼-138
|
||||
- 课程时间:
|
||||
- 05月21日8:30-11:20
|
||||
- 05月26日8:30-11:20
|
||||
- 05月28日8:30-11:20
|
||||
- 06月02日8:30-11:20
|
||||
- 06月04日8:30-11:20
|
||||
|
||||
# 课件
|
||||
|
||||
- 网页公开:[https://drc.drwater.net/course/public/RWEP/\@PUB/index.html](https://drc.drwater.net/course/public/RWEP/@PUB/index.html)
|
||||
- 课件代码:[https://git.drwater.net/course/RWEP.git](https://git.drwater.net/course/RWEP.git)
|
||||
|
||||
Reference in New Issue
Block a user