knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Before every semester when preparing the infrastructure for a new course or for a new version of an existing course, the same tasks have to be carried out. The outline given below gives a few hints and ideas on how this process could be automated. In what follows, we start with a description of the manual process that is used so far. The second part contains possible ideas for automation.
The course is assumed to be a course consisting of the following components
The structure of the course should be kept as flexible as possible. Hence, further components such as student projects or homework or term projects should be easily integrable.
The following steps are taken in the setup process
R -e 'usethis::create_project(path = "/Users/pvr/Data/Projects/Github/charlotte-ngs/asmss2022_gh-root/main/asmss2022", rstudio = TRUE)'
usethis::use_description(fields = getOption("charlotte.ngs.description"))
This file must be edited and adapted according to the new course. This can be done via
usethis::edit_file(path = "DESCRIPTION")
usethis::use_cc0_license()
usethis::use_readme_rmd()
The README file is the main page of content, not only for the Github page, but also for the website which will be created via pkgdown
usethis::use_git()
usethis::use_vignette(name = "course_notes", title = "Course Notes") usethis::use_vignette(name = "course_exercises", title = "Exercises") usethis::use_vignette(name = "course_solutions", title = "Solutions") usethis::use_vignette(name = "course_additional_material", title = "Additional Material")
usethis::use_news_md()
devtools::document();devtools::install()
pkgdown::build_site()
After committing and pushing all the material, the material should be available.
cd && cd Data/Projects/GitHub/charlotte-ngs ~/Data/Projects/GitHub/fbzwsqualitasag/qmactools/inst/bash/nrsproj.sh \ -t ~/Data/Projects/GitHub/fbzwsqualitasag/qmactools/inst/template/rstudio/RStudioTemplate.Rproj \ -p pigsciencess2022_gh-root/main/pigsciencess2022
usethis::use_description()
This file must be edited and adapted according to the new course. This can be done via
usethis::edit_file(path = "DESCRIPTION")
usethis::use_cc0_license()
usethis::use_readme_rmd()
The README file is the main page of content, not only for the Github page, but also for the website which will be created via pkgdown
usethis::use_git()
usethis::use_vignette(name = "course_notes", title = "Course Notes") usethis::use_vignette(name = "course_exercises", title = "Exercises") usethis::use_vignette(name = "course_solutions", title = "Solutions") usethis::use_vignette(name = "course_additional_material", title = "Additional Material")
usethis::use_news_md()
devtools::document();devtools::install()
pkgdown::build_site()
Create the new repo on the Github platform and run locally
git remote add origin https://github.com/charlotte-ngs/pigsciencess2022.git git branch -M main git config user.name "charlotte-ngs" git config credential.username "charlotte-ngs" git push -u origin main
After committing and pushing all the material, the material should be available.
usethis::use_rmarkdown_template(template_name = "Course Notes Bookdown Skeleton Project", template_dir = 'cnotesdown', template_description = 'Course Notes Bookdown Skeleton Project for Charlotte-NGS', template_create_dir = TRUE)
Install package to make template available
devtools::document();devtools::install()
rmarkdown::draft("cn", template = "cnotesdown", package = "rteachtools") fs::file_move("cn/cn.Rmd", "cn/index.Rmd")
Change template settings
Create template
usethis::use_rmarkdown_template(template_name = "Course Beamer Slide Skeleton Document", template_dir = 'cbeamerdown', template_description = 'Course Beamer Slide Skeleton Document for Charlotte-NGS', template_create_dir = TRUE)
Start a new slides document
rmarkdown::draft("sl/l01_psb_intro", template = "cbeamerdown", package = "rteachtools")
Exams are created in a special Rmarkdown document using latex-features to create a title page.
usethis::use_rmarkdown_template(template_name = "Exam Questions Skeleton Document", template_dir = 'cexamdown', template_description = 'Exam Template Document for charlotte-ngs', template_create_dir = TRUE)
Using the template works with
rmarkdown::draft(file = "exam/asm_exam_sol", template = "cexamdown", package = "rteachtools")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.