add version
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
\newlabel{r:r1q0101}{{This is something useful according to Reviewer 1.}{}}
|
||||
\newlabel{r1q0101}{{1}{3}{\texorpdfstring {Main}{Main}}{section.1}{}}
|
||||
\newlabel{r1q0101end}{{1}{3}{\texorpdfstring {Main}{Main}}{section.1}{}}
|
||||
\newlabel{line:r1q0101}{{11}{3}{}{}{}}
|
||||
\newlabel{line:r1q0101end}{{11}{3}{}{}{}}
|
||||
\newlabel{line:r1q0101}{{12}{3}{}{}{}}
|
||||
\newlabel{line:r1q0101end}{{12}{3}{}{}{}}
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Methods}{3}{section.2}\protected@file@percent }
|
||||
\newlabel{methods}{{2}{3}{\texorpdfstring {Methods}{Methods}}{section.2}{}}
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Results}{3}{section.3}\protected@file@percent }
|
||||
|
||||
@@ -51,6 +51,8 @@ dwfun::init()
|
||||
|
||||
# Abstract {-}
|
||||
|
||||
This is the abstract.
|
||||
|
||||
{{< pagebreak >}}
|
||||
|
||||
{{< include MS_main.qmd >}}
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ project:
|
||||
output-dir: www/
|
||||
render:
|
||||
- index.qmd
|
||||
- version.qmd
|
||||
- MS/SM.qmd
|
||||
- MS/MS.qmd
|
||||
- MS/CL.qmd
|
||||
@@ -128,7 +129,7 @@ website:
|
||||
- text: "Links"
|
||||
menu:
|
||||
- text: "Version"
|
||||
href: https://drc.drwater.net/{{< var projtype >}}/{{< var pubtype >}}/{{< var reponame >}}/
|
||||
href: version.qmd
|
||||
- text: "DRC"
|
||||
href: "https://drc.drwater.net/"
|
||||
- text: "Dr. Water"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: "About"
|
||||
author: ""
|
||||
---
|
||||
|
||||
About this site
|
||||
About this site.
|
||||
|
||||
@@ -7,7 +7,7 @@ engine: knitr
|
||||
```{r}
|
||||
#| echo: false
|
||||
#| out-width: 100%
|
||||
dwfun::ggsavep("./figures/GA20240729.pdf", loadit = TRUE)
|
||||
# dwfun::ggsavep("./figures/GA20240729.pdf", loadit = TRUE)
|
||||
```
|
||||
|
||||
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
---
|
||||
subtitle: "Version"
|
||||
author: ""
|
||||
---
|
||||
|
||||
### Branches
|
||||
|
||||
|
||||
```{r}
|
||||
#| echo: false
|
||||
#| output: asis
|
||||
|
||||
tibble::tibble(branch = system("git branch -a", intern = TRUE)) |>
|
||||
dplyr::filter(grepl("remotes", branch)) |>
|
||||
dplyr::filter(!grepl("HEAD", branch)) |>
|
||||
dplyr::mutate(branch = gsub("^.*\\/", "", branch)) |>
|
||||
dplyr::mutate(
|
||||
htmlstr = paste0(
|
||||
"## [**Version**: ",
|
||||
branch,
|
||||
"](https://drc.drwater.net/{{< var projtype >}}/{{< var pubtype >}}/{{< var reponame >}}/",
|
||||
branch,
|
||||
"/)<br><br>"
|
||||
)
|
||||
) |>
|
||||
dplyr::pull(htmlstr) |>
|
||||
paste(collapse = "") |>
|
||||
cat()
|
||||
```
|
||||
|
||||
### Versions
|
||||
|
||||
```{r}
|
||||
#| echo: false
|
||||
#| output: asis
|
||||
|
||||
# 方法2:先获取分支列表,再逐个查询
|
||||
branches <- system("git branch -r", intern = TRUE)
|
||||
branches <- trimws(branches) # 去除空白字符
|
||||
branches <- branches[!grepl("HEAD", branches)]
|
||||
|
||||
all_commits <- list()
|
||||
|
||||
cat("\n")
|
||||
for (branch in branches) {
|
||||
if (branch != "") {
|
||||
cat("### ", gsub("^.*/", "", branch), "\n\n")
|
||||
commits <- system(
|
||||
paste0(
|
||||
"git log --pretty=format:\"%h - %an, %ar : %s\" -5 \"",
|
||||
branch,
|
||||
"\""
|
||||
),
|
||||
intern = TRUE
|
||||
)
|
||||
all_commits[[branch]] <- paste0("- ", commits)
|
||||
cat("\n")
|
||||
cat(paste0("- ", commits), sep = "\n")
|
||||
cat("\n\n")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user