library(fs) library(dplyr) library(purrr) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
r packageDescription("rdtest", fields = "Title")
: r packageDescription("rdtest", fields = "Description")
Notebooks in this package:
rmd_metadata <- function(filename) { # get notebook yaml yfm <- rmarkdown::yaml_front_matter(filename) # get notebook 'description' line - first non-blank line after front matter # warning: assumes the document has valid front matter bounded by ^---$ notebook <- readLines(filename) header <- grep("^---$", notebook) body_start <- header[2] + 1 body_end <- length(notebook) desc_line <- grep("[:graph:]", notebook[body_start:body_end])[1] + header[2] gh_url <- paste0( desc::desc_get_urls()[1], "/", fs::path_ext_remove(fs::path_file(filename)), ".html" ) list(title = yfm$title, url = gh_url, date = yfm$date, description = notebook[desc_line]) } notebooks <- dir_ls("analysis", glob = "*.Rmd") |> map_dfr(rmd_metadata) |> mutate(bullet = paste0( "- [", title, "](", url, ") (", date, "): ", description )) |> pull(bullet) writeLines(notebooks)
You can install the development version of rdtest from GitHub with:
# install.packages("devtools") devtools::install_github("jabenninghoff/rdtest")
Or using renv:
# install.packages("renv") renv::install("jabenninghoff/rdtest")
NEWS.md
.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.