dvirlar2 / datateam-training

Training and reference materials for ADC and SASAP data team members
https://nceas.github.io/datateam-training/training/
Apache License 2.0
1 stars 0 forks source link

Convert to quarto document #10

Closed dvirlar2 closed 2 years ago

dvirlar2 commented 2 years ago

Helpful code from here

1. Change filenames from .Rmd to .qmd:

library(fs)
library(stringr)

rmd_names <- dir_ls(path = ".", glob = "*.Rmd")
qmd_names <- str_replace(string = rmd_names, 
                         pattern = "Rmd",
                         replacement = "qmd")

file_move(path = rmd_names, new_path = qmd_names)

file_move(path = "_bookdown.yml", new_path = "_quarto.yml"

2. Edit the bookdown structure

quarto_yaml_rmd <- read_lines("_quarto.yml")

quarto_yaml_qmd <- str_replace_all(string = quarto_yaml_rmd, pattern = "Rmd", replacement = "qmd")

write_lines(x = quarto_yaml_qmd, file = "_quarto.yml")