View source: R/lesson_rename.R
lesson_rename | R Documentation |
Scenario where working title changes midway through project development. Does several things:
Renames top-level folder of the lesson with "new_proj_name"
Finds and renames all file names to found in the project folder e.g. OldShortTitle_yadayada.* -> NewShortTitle_yadayada. This is done locally using Google Drive for Desktop virtualization of the Lessons Folder
Changes name of GitHub Repo at galacticpolymath/ and galacticpolymath/catalog to "new_proj_name"
Reassociates lesson folder to new GitHub name with gh_reset_remote()
Changes the ShortTitle and GPCatalogURL and GitHubURL items in front-matter.yml using update_fm()
.
lesson_rename(
new_ShortTitle,
new_proj_name,
WD = "?",
curr_ShortTitle,
just_files = FALSE,
change_this = NULL,
only_rename_prefixes = TRUE,
preserve_spaces = FALSE,
run_check_wd = TRUE,
force_init_capital = TRUE,
exclude_TEST = TRUE
)
new_ShortTitle |
New ShortTitles to be swapped out in lesson project file names. If blank, will try to guess by ignoring terminal "_suffixes" |
new_proj_name |
The new name you want to give the selected project |
WD |
a virtualized path to the lesson you want to rename. Easiest to specify "?" which will invoke |
curr_ShortTitle |
Current ShortTitle prefixed to lesson project files. If missing, will try to read this from ShortTitle in the existing front-matter.yml |
just_files |
logical; Default=FALSE; Do you want to JUST rename file prefixes, given the ShortTitle? If TRUE, this skips:
|
change_this |
passed to |
only_rename_prefixes |
Do you want to only change project files with the ShortTitle at the beginning (and also end) of the filename? (Could avoid accidental replacements if short title is a common phrase); default=TRUE |
preserve_spaces |
if some files have a space in the 'Short Title', do you want to preserve this? default=FALSE |
run_check_wd |
logical; do you want to run |
force_init_capital |
do you want to force the output to start with a capital letter? default=FALSE |
exclude_TEST |
default=T; excludes test repositories. Passed to |
Assumes that you have Google Drive for Desktop set up with access to Lessons/ folder; github and gh CLI set up with proper permissions with GP GitHub. Will ignore case to account for different user behaviors.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.