::copy_folder_contents_to_dir(
saros.base
from, to = getwd(),
only_copy_folders = FALSE)
Warning
Irrespective of the path A or B taken below, you want to distinguish between
the folder where report generations are placed (never store your own work here as it may be overwritten by Saros)
the folder for each chapter where one writes, edits and store versions for proofing, etc. Saros will never touch these folders.
the folder where complete chapters are placed for publication on a website. Quarto Website Project will read from this and generate a website, reports as PDFs, DOCXs, etc.
Copy from an existing project using Saros, and edit the 00*_ R-files and _quarto.yaml files for project-specific settings.
::copy_folder_contents_to_dir(
saros.base
from, to = getwd(),
only_copy_folders = FALSE)
Very often you have an existing project going, and only want to add the Saros-specific report production setup.
An easy basis to get going is the project template used by the Nordic Institute for the Studies of Innovation, Research, and Education (NIFU). Remember to have your project folder synchronized if this already exists.
library(saros.base)
::download_zip_to_folder(out_path = fs::path(getwd(), "Saros")) # Set to your project folder's Saros-folder (keep absolute folder path as short as possible) saros.base
This will create empty folders and thus force projects to follow a certain template. The template can be modified to an organization’s liking.
# Modify these to your liking
<-
project_path ::path(getwd())
fs<- "SMILE"
project_initials <- "Saros"
saros_folder_name <- "project_folder_structure.yaml"
project_structure_yaml_path
# Se function help for more details
::initialize_saros_project(
saros.basepath = project_path,
structure_path = project_structure_yaml_path,
replacement_list = c("prosjekt_initialer" = project_initials),
numbering_prefix = "global_max",
numbering_inheritance = TRUE,
word_separator = NULL,
numbering_name_separator = " ",
numbering_parent_child_separator = NULL,
case = "asis",
count_existing_folders = FALSE,
r_files_out_path = fs::path(project_path, paste0(saros_folder_name, project_initials), "01_script", "script_templates"),
create = FALSE) # SET create = TRUE when you are satisfied with the folder structure
This is a quick approach to changing the most important settings. See further below for a more detailed explanation.
<- yaml::read_yaml(file.path("02_resources", "YAML", "_quarto.yaml"))
quarto_yaml
$website$title <- "PROJECT TITLE"
quarto_yaml$website$`site-url` <- "WEBSITE URL"
quarto_yaml$project_no <- "INTERNAL PROJECT NUMBER" # Usually not needed
quarto_yaml$funder <- "FUNDER"
quarto_yaml$funder_address <- "FUNDER'S ADDRESS"
quarto_yaml::write_yaml(quarto_yaml, file = file.path("02_resources", "YAML", "_quarto.yaml"))
yaml
<- yaml::read_yaml(file.path("02_resources", "YAML", "_report_header.yaml"))
report_yaml $signer_1 <- "REPORT SIGNER 1"
report_yaml$signer_1_title <- "REPORT SIGNER 1 JOB TITLE"
report_yaml$signer_1 <- "REPORT SIGNER 2"
report_yaml$signer_1_title <- "REPORT SIGNER 2 JOB TITLE"
report_yaml$report_type <- "rapport" # Usually not needed
report_yaml::write_yaml(report_yaml, file = file.path("02_resources", "YAML", "_report_header.yaml")) yaml