From 6ca342f89d84db2fe682f0717e081721636b0514 Mon Sep 17 00:00:00 2001 From: ming Date: Wed, 26 Nov 2025 14:46:46 +0800 Subject: [PATCH] add version --- MS/MS.aux | 4 ++-- MS/MS.qmd | 2 ++ _metadata.yml | 3 ++- about.qmd | 3 ++- index.qmd | 2 +- version.qmd | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 version.qmd diff --git a/MS/MS.aux b/MS/MS.aux index b7e7744..75e390d 100644 --- a/MS/MS.aux +++ b/MS/MS.aux @@ -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 } diff --git a/MS/MS.qmd b/MS/MS.qmd index 14b807a..3115fb2 100644 --- a/MS/MS.qmd +++ b/MS/MS.qmd @@ -51,6 +51,8 @@ dwfun::init() # Abstract {-} +This is the abstract. + {{< pagebreak >}} {{< include MS_main.qmd >}} diff --git a/_metadata.yml b/_metadata.yml index c49fb28..4ed013e 100644 --- a/_metadata.yml +++ b/_metadata.yml @@ -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" diff --git a/about.qmd b/about.qmd index 07c5e7f..dd3194f 100644 --- a/about.qmd +++ b/about.qmd @@ -1,5 +1,6 @@ --- title: "About" +author: "" --- -About this site +About this site. diff --git a/index.qmd b/index.qmd index ec158c0..fc8a56e 100755 --- a/index.qmd +++ b/index.qmd @@ -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) ``` diff --git a/version.qmd b/version.qmd new file mode 100644 index 0000000..f350145 --- /dev/null +++ b/version.qmd @@ -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, + "/)

" + ) + ) |> + 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") + } +} +``` + +