-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
60 lines (47 loc) · 1.97 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
output: github_document
---
<!-- force push by editing this number: 47 -->
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# roz <img src="man/figures/logo.png" align="right" height="137" alt="" />
<!-- badges: start -->
[](https://github.com/fwimp/roz/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
`roz` allows for R access to a variety of services provided by the [onezoom](https://www.onezoom.org) project.
## Installation
You can install the development version of roz like so:
``` r
# install.packages("devtools")
devtools::install_github("fwimp/roz", build_vignettes = TRUE)
```
## Latest patch notes
```{r echo=FALSE}
# Note this only handles up to h2 level right now. Will need some fiddling if more is needed further down the line!
# In that case might be worth detecting and generating arbitrary levels of nesting with some clever recursive programming.
news <- parsermd::as_tibble(parsermd::parse_rmd(system.file("NEWS.md", package = "roz")))
md_chunks <- subset(news, type=="rmd_markdown")
latest_version <- md_chunks[[1,1]]
filtered_md_chunks <- subset(md_chunks, md_chunks$sec_h1 == latest_version)
notes <- c()
notes <- tryCatch({
for (i in 1:nrow(filtered_md_chunks)) {
# cat(paste0("## ", filtered_md_chunks[i, "sec_h2"], "\n\n", parsermd::as_document(md_chunks[[i,"ast"]], collapse = "\n")))
notes <- c(notes, paste0("#### ", filtered_md_chunks[i, "sec_h2"], "\n\n", parsermd::as_document(md_chunks[[i,"ast"]], collapse = "\n")))
}
paste(notes, collapse = "\n")
}, error = function(e) {
parsermd::as_document(md_chunks[[1,"ast"]], collapse = "\n")
})
# notes <- parsermd::as_document(md_chunks[[1,"ast"]], collapse = "\n")
```
<!-- These are auto-pulled from NEWS.md -->
### `r latest_version`
`r notes`