Skip to content

Commit 73c00ba

Browse files
committedDec 12, 2024··
Add patches to proper render README.md
1 parent 88729fe commit 73c00ba

File tree

4 files changed

+65
-6
lines changed

4 files changed

+65
-6
lines changed
 

‎.Rbuildignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
^\.github$
22
^\.lintr$
33
^\.Rproj\.user$
4+
^_quarto\.yml$
45
^_pkgdown\.yml$
56
^CITATION\.cff$
67
^CODE_OF_CONDUCT\.md$
@@ -17,5 +18,6 @@
1718
^mctq\.Rproj$
1819
^Meta$
1920
^pkgdown$
21+
^R/\.post-render\.R$
2022
^README\.qmd$
2123
^revdep$

‎R/.post-render.R

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# library(beepr)
2+
# library(cffr)
3+
# library(codemetar)
4+
# library(groomr) # https://github.com/danielvartan/groomr
5+
# library(here)
6+
# library(readr)
7+
# library(rutils) # https://github.com/danielvartan/rutils
8+
# library(stringr)
9+
10+
# Remove empty lines from `README.md` -----
11+
12+
groomr::remove_blank_line_dups(here::here("README.md"))
13+
14+
# Update package versions in `DESCRIPTION` -----
15+
16+
rutils::update_pkg_versions()
17+
18+
# Update package year -----
19+
20+
files <- c(
21+
here::here("LICENSE"),
22+
here::here("LICENSE.md"),
23+
here::here("inst", "CITATION")
24+
)
25+
26+
for (i in files) {
27+
data <-
28+
i |>
29+
readr::read_lines() |>
30+
stringr::str_replace_all(
31+
pattern = "20\\d{2}",
32+
replacement = as.character(Sys.Date() |> lubridate::year())
33+
)
34+
35+
data |> readr::write_lines(i)
36+
}
37+
38+
# Update `cffr` and `codemeta` -----
39+
40+
cffr::cff_write()
41+
codemetar::write_codemeta()
42+
43+
# Check if the script ran successfully -----
44+
45+
beepr::beep(1)
46+
47+
Sys.sleep(3)

‎README.qmd

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
---
2-
editor: source
3-
format: gfm
4-
---
5-
61
```{r}
72
#| label: setup
83
#| include: false
94
5+
library(beepr)
6+
library(cffr)
7+
library(codemetar)
108
library(mctq)
11-
library(lubridate)
9+
library(groomr) # https://github.com/danielvartan/groomr
10+
library(here)
1211
library(hms)
12+
library(lubridate)
13+
library(readr)
14+
library(rutils) # https://github.com/danielvartan/rutils
15+
library(stringr)
1316
```
1417

1518
# mctq <a href = "https://docs.ropensci.org/mctq/"><img src = "man/figures/logo.png" align="right" height="139" /></a>

‎_quarto.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
editor: source
2+
3+
project:
4+
render: [README.qmd]
5+
post-render: "R/.post-render.R"
6+
7+
format: gfm

0 commit comments

Comments
 (0)
Please sign in to comment.