diff --git a/.github/ISSUE_TEMPLATE/problem-report.md b/.github/ISSUE_TEMPLATE/problem-report.md index bfaee7a..5d09837 100644 --- a/.github/ISSUE_TEMPLATE/problem-report.md +++ b/.github/ISSUE_TEMPLATE/problem-report.md @@ -1,6 +1,6 @@ --- name: Problem Report -about: Create a report to help improve leanbuild and its documentation +about: Create a report to help improve ottr and its documentation title: problem labels: bug assignees: cansavvy @@ -24,7 +24,7 @@ A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. -What does the render look like versus what did you write and supply to `leanbuild`? +What does the render look like versus what did you write and supply to `ottr`? **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/update-leanpub.yml b/.github/workflows/update-leanpub.yml index 79ecdbe..446a21c 100644 --- a/.github/workflows/update-leanpub.yml +++ b/.github/workflows/update-leanpub.yml @@ -3,7 +3,7 @@ name: Update Leanpub Upon Merge -# Triggers the workflow AFTER changes to leanbuild have been merged +# Triggers the workflow AFTER changes to ottr have been merged on: workflow_dispatch: push: @@ -24,20 +24,20 @@ jobs: repository: jhudsl/OTTR_Quizzes token: ${{ secrets.GH_PAT }} - # Copy over the latest leanbuild and use that for the run - - name: Get latest leanbuild + # Copy over the latest ottr and use that for the run + - name: Get latest ottr run: | sudo apt-get install -y --no-install-recommends subversion - # Copy over the latest leanbuild build - svn export https://github.com/${GITHUB_REPOSITORY}.git/branches/master leanbuild/ + # Copy over the latest ottr build + svn export https://github.com/${GITHUB_REPOSITORY}.git/branches/master ottr/ # Run leanpub rendering - - name: Run leanbuild::bookdown_to_leanpub + - name: Run ottr::bookdown_to_leanpub run: | - Rscript -e "devtools::load_all('leanbuild'); leanbuild::bookdown_to_leanpub(footer_text = '*Please provide any feedback with [this form!](https://forms.gle/hc8Xt3Y2Znjb6M4Y7) We appreciate your thoughts.*')" - Rscript -e "devtools::load_all('leanbuild'); leanbuild::render_coursera(convert_quizzes = TRUE)" - rm -r leanbuild + Rscript -e "devtools::load_all('ottr'); ottr::bookdown_to_leanpub(footer_text = '*Please provide any feedback with [this form!](https://forms.gle/hc8Xt3Y2Znjb6M4Y7) We appreciate your thoughts.*')" + Rscript -e "devtools::load_all('ottr'); ottr::render_coursera(convert_quizzes = TRUE)" + rm -r ottr - name: Create PR with newly rendered docs files @@ -45,15 +45,15 @@ jobs: id: cpr with: token: ${{ secrets.GH_PAT }} - commit-message: Show latest leanbuild changes + commit-message: Show latest ottr changes signoff: false branch: auto_copy_rendered_files delete-branch: true - title: 'GHA: Automated transfer re-render with leanbuild update' + title: 'GHA: Automated transfer re-render with ottr update' body: | ### Description: - This PR has changes to this repository's files using the latest leanbuild package changes! - If they don't look right, file an issue on the leanbuild package: https://github.com/jhudsl/leanbuild/issuesand do not merge. + This PR has changes to this repository's files using the latest ottr package changes! + If they don't look right, file an issue on the ottr package: https://github.com/jhudsl/ottr/issuesand do not merge. labels: | automated reviewers: $GITHUB_ACTOR diff --git a/DESCRIPTION b/DESCRIPTION index 92a17d6..4a1b192 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: leanbuild +Package: ottr Version: 0.1.2 Title: Tools for Creating Automated Courses Description: Leverages the 'bookdown' package and other tools to create courses @@ -48,6 +48,6 @@ Remotes: jhudsl/text2speech, ByteCompile: true Type: Package VignetteBuilder: knitr -URL: https://github.com/jhudsl/leanbuild -BugReports: https://github.comjhudsl/leanbuild/issues +URL: https://github.com/jhudsl/ottr +BugReports: https://github.comjhudsl/ottr/issues RoxygenNote: 7.1.1 diff --git a/LICENSE.md b/LICENSE.md index ca74e24..eef9374 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -573,7 +573,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - leanbuild Copyright (C) 2021 John Muschelli + ottr Copyright (C) 2021 John Muschelli This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details. diff --git a/NEWS.md b/NEWS.md index 36250e0..58ff914 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,3 @@ -# leanbuild 0.1.0 +# ottr 0.1.0 * Added a `NEWS.md` file to track changes to the package. diff --git a/R/bookdown_to_leanpub.R b/R/bookdown_to_leanpub.R index 1c7ba82..7a657a3 100644 --- a/R/bookdown_to_leanpub.R +++ b/R/bookdown_to_leanpub.R @@ -175,7 +175,7 @@ copy_quizzes <- function(quiz_dir = "quizzes", output_dir = "manuscript") { #' @param remove_resources_start remove the word `resources/` at the front #' of any image path. #' @param run_quiz_checks TRUE/FALSE run quiz checks -#' @param make_book_txt Should [leanbuild::bookdown_to_book_txt()] be run +#' @param make_book_txt Should [ottr::bookdown_to_book_txt()] be run #' to create a `Book.txt` in the output directory? #' @param quiz_dir directory that contains the quiz .md files that should be #' checked and incorporated into the Book.txt file. If you don't have quizzes, diff --git a/R/coursera.R b/R/coursera.R index a75c32b..2b30b36 100644 --- a/R/coursera.R +++ b/R/coursera.R @@ -229,7 +229,7 @@ render_coursera <- function(output_dir = file.path("docs", "coursera"), toc_close_css <- file.path(root_dir, "assets", "toc_close.css") if (!file.exists(toc_close_css)) { - download.file("https://raw.githubusercontent.com/jhudsl/leanbuild/master/inst/extdata/toc_close.css", + download.file("https://raw.githubusercontent.com/jhudsl/ottr/master/inst/extdata/toc_close.css", destfile = toc_close_css ) } diff --git a/R/example_data.R b/R/example_data.R index 2334f95..a220936 100644 --- a/R/example_data.R +++ b/R/example_data.R @@ -11,7 +11,7 @@ good_quiz_path <- function() { list.files( pattern = "quiz_good.md$", recursive = TRUE, - system.file("extdata", package = "leanbuild"), + system.file("extdata", package = "ottr"), full.names = TRUE ) } @@ -27,7 +27,7 @@ bad_quiz_path <- function() { list.files( pattern = "quiz_bad.md$", recursive = TRUE, - system.file("extdata", package = "leanbuild"), + system.file("extdata", package = "ottr"), full.names = TRUE ) } @@ -40,11 +40,11 @@ bad_quiz_path <- function() { #' @importFrom fs dir_copy #' @examples #' # Run this to get the files we need -#' example_files <- leanbuild::example_repo_setup() +#' example_files <- ottr::example_repo_setup() example_repo_setup <- function(dest_dir = ".") { bookdown_path <- list.files( pattern = "_bookdown.yml$", - system.file("extdata/", package = "leanbuild"), + system.file("extdata/", package = "ottr"), full.names = TRUE ) @@ -65,7 +65,7 @@ example_repo_setup <- function(dest_dir = ".") { #' @examples #' #' # Run this to get the files we need -#' example_files <- leanbuild::example_repo_setup() +#' example_files <- ottr::example_repo_setup() #' #' # Run this to delete them #' example_repo_cleanup(files_to_remove = basename(example_files)) diff --git a/R/quiz.R b/R/quiz.R index 697c33d..c1d770b 100644 --- a/R/quiz.R +++ b/R/quiz.R @@ -264,7 +264,7 @@ extract_quiz <- function(quiz_lines) { #' Check Quiz Attributes #' -#' @param quiz_specs The output from [leanbuild::parse_quiz]. +#' @param quiz_specs The output from [ottr::parse_quiz]. #' @param quiz_name A character string indicating the name of the quiz being checked. #' @param verbose Would you like progress messages? TRUE/FALSE #' @@ -314,10 +314,10 @@ check_quiz_attributes <- function(quiz_specs, quiz_name = NULL, verbose = TRUE) } #' Check a question's attributes #' -#' This is ran automatically by [leanbuild::check_all_questions] for all questions. +#' This is ran automatically by [ottr::check_all_questions] for all questions. #' It checks that the attributes specified are accepted ones by Leanpub. #' -#' @param question_df a data.frame obtained from [leanbuild::parse_quiz_df] and dplyr::group_split(question). +#' @param question_df a data.frame obtained from [ottr::parse_quiz_df] and dplyr::group_split(question). #' @param quiz_name inherited from parse #' @param verbose print diagnostic messages #' @@ -361,14 +361,14 @@ check_quiz_question_attributes <- function(question_df, #' Check all quiz questions #' -#' Takes output from [leanbuild::parse_quiz] and runs checks on each question in a quiz by calling [leanbuild::check_question] for each question. +#' Takes output from [ottr::parse_quiz] and runs checks on each question in a quiz by calling [ottr::check_question] for each question. #' First splits questions into their own data frame. Returns a list of messages/warnings about each question's set up. #' -#' @param quiz_specs quiz_specs which is output from [leanbuild::parse_quiz]. +#' @param quiz_specs quiz_specs which is output from [ottr::parse_quiz]. #' @param quiz_name The name of the quiz being checked. #' @param verbose Whether progress messages should be given. #' -#' @return A list of the output from [leanbuild::check_question] with messages/warnings regarding each question and each check. +#' @return A list of the output from [ottr::check_question] with messages/warnings regarding each question and each check. #' #' @export check_all_questions #' @@ -420,7 +420,7 @@ check_all_questions <- function(quiz_specs, quiz_name = NA, verbose = TRUE) { #' #' Check quiz question set up to see if it is compliant with Leanpub and Coursera needs. #' Based off of [Markua guide](https://leanpub.com/markua/read#leanpub-auto-quizzes-and-exercises). -#' Is called by [leanbuild::check_all_questions] and run for each question. +#' Is called by [ottr::check_all_questions] and run for each question. #' #' @param question_df Which is an individual question's data frame after being parse from #' @param quiz_name The name of the quiz the question is from @@ -604,7 +604,7 @@ check_question <- function(question_df, quiz_name = NA, verbose = TRUE) { #' #' Check the formatting of all quizzes in a given directory. #' -#' @param quiz_dir A path to a directory full of quizzes that should all be checked with [leanbuild::check_all_quizzes]. +#' @param quiz_dir A path to a directory full of quizzes that should all be checked with [ottr::check_all_quizzes]. #' @param verbose print diagnostic messages #' @param write_report TRUE/FALSE save warning report to a CSV file? #' diff --git a/R/remove_yaml.R b/R/remove_yaml.R index 7e6e04b..88cc624 100644 --- a/R/remove_yaml.R +++ b/R/remove_yaml.R @@ -40,7 +40,7 @@ partition_yaml_front_matter <- function(input_lines) { #' @export #' #' @examples -#' file <- system.file("extdata/00_template.Rmd", package = "leanbuild") +#' file <- system.file("extdata/00_template.Rmd", package = "ottr") #' out <- remove_yaml_header(file) #' head(out) remove_yaml_header <- function(file) { diff --git a/README.Rmd b/README.Rmd index 1b0b716..849390d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -3,7 +3,7 @@ output: github_document --- -[![R-CMD-check](https://github.com/jhudsl/leanbuild/workflows/R-CMD-check/badge.svg)](https://github.com/jhudsl/leanbuild/actions) +[![R-CMD-check](https://github.com/jhudsl/ottr/workflows/R-CMD-check/badge.svg)](https://github.com/jhudsl/ottr/actions) @@ -16,17 +16,17 @@ knitr::opts_chunk$set( ) ``` -# leanbuild Package: +# ottr Package: -The goal of `leanbuild` is to provide tools to convert from Bookdown content to Leanpub content and do some checks. +The goal of `ottr` is to provide tools to convert from Bookdown content to Leanpub content and do some checks. ## Installation -You can install `leanbuild` from GitHub with: +You can install `ottr` from GitHub with: ```{r gh-installation, eval = FALSE} # install.packages("remotes") -remotes::install_github("jhudsl/leanbuild") +remotes::install_github("jhudsl/ottr") ``` @@ -36,7 +36,7 @@ Within a bookdown repository, you can run the following command to convert your content to a Leanpub-ready format. ```{r, eval = FALSE} -leanbuild::bookdown_to_leanpub() +ottr::bookdown_to_leanpub() ``` By default the output files will be sent to a `manuscript` folder which is what Leanpub looks for. diff --git a/README.md b/README.md index 0c6aeda..0423b9a 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,31 @@ -[![R-CMD-check](https://github.com/jhudsl/leanbuild/workflows/R-CMD-check/badge.svg)](https://github.com/jhudsl/leanbuild/actions) +[![R-CMD-check](https://github.com/jhudsl/ottr/workflows/R-CMD-check/badge.svg)](https://github.com/jhudsl/ottr/actions) -# Intro to leanbuild +# Intro to ottr -`leanbuild` converts an [OTTR-made course](https://github.com/jhudsl/OTTR_Template/wiki) into a [Leanpub-ready](https://leanpub.com/) set of files. +`ottr` converts an [OTTR-made course](https://github.com/jhudsl/OTTR_Template/wiki) into a [Leanpub-ready](https://leanpub.com/) set of files. The output rendered files from this package can be published using the [Github writing mode on Leanpub](https://leanpub.com/lfm/read#leanpub-auto-switching-writing-modes). -[Read the full documentation here](https://jhudatascience.org/leanbuild/docs/index.html). +[Read the full documentation here](https://jhudatascience.org/ottr/docs/index.html). ## Required files: -Before you are ready to run `leanbuild`, you will need the following files (which are standard in a `Bookdown` repository): +Before you are ready to run `ottr`, you will need the following files (which are standard in a `Bookdown` repository): - a `_bookdown.yml` file which lists the `.Rmd` files that are to be rendered in a `rmd: ` category (see [example file](https://github.com/jhudsl/OTTR_Quizzes/blob/main/_bookdown.yml)). - `.Rmd` files which contain the chapter content (including your `index.Rmd` file which `Bookdown` has). - an `images` directory that contains any images that are referenced in the chapters. - `.bib` file(s) to complete any citation renders (see [example file](https://github.com/jhudsl/OTTR_Quizzes/blob/main/book.bib)). _Optionally:_ -- [a `Book.txt` file](https://leanpub.com/lfm/read#leanpub-auto-booktxt-sampletxt-and-manuscript-files) which lists the order of the chapters/quiz files (this can be autogenerated with `leanbuild`) (see [example file](https://github.com/jhudsl/OTTR_Quizzes/blob/main/Book.txt)). +- [a `Book.txt` file](https://leanpub.com/lfm/read#leanpub-auto-booktxt-sampletxt-and-manuscript-files) which lists the order of the chapters/quiz files (this can be autogenerated with `ottr`) (see [example file](https://github.com/jhudsl/OTTR_Quizzes/blob/main/Book.txt)). - a directory containing quizzes in the form of `.md` files which have been written using the [Markua formatting specifications](https://leanpub.com/markua/read#leanpub-auto-quizzes-and-exercises) (see [example folder](https://github.com/jhudsl/OTTR_Quizzes/tree/main/quizzes)). -Here's an example of what the Bookdown file set up (which leanbuild will look for) might be set up like: +Here's an example of what the Bookdown file set up (which ottr will look for) might be set up like: ``` A_Bookdown_Repo ├── _bookdown.yml @@ -53,16 +53,16 @@ git clone https://github.com/{organization}/OTTR_Quizzes.git ``` But replace `{organization}` with the location of your forked repository. -## Installing leanbuild: +## Installing ottr: -You can install `leanbuild` from GitHub with: +You can install `ottr` from GitHub with: You will need to use the remotes package (and will need to install it if you don't have it). ``` r if (!("remotes" %in% installed.packages())) { install.packages("remotes") } -remotes::install_github("jhudsl/leanbuild") +remotes::install_github("jhudsl/ottr") ``` ## Setting up the Rmds and images folder: @@ -71,40 +71,40 @@ Each of your Rmds needs to have this chunk of code in the beginning of the file: `````{r} ```{r, include = FALSE} -leanbuild::set_knitr_image_path() +ottr::set_knitr_image_path() ``` ````` This will ensure that the images are stored in the correct place and will be rendered correctly both in `Bookdown` and in Leanpub. -## Running leanbuild +## Running ottr -The `leanbuild` package converts your files using this main function: +The `ottr` package converts your files using this main function: ```{r} -leanbuild::bookdown_to_leanpub() +ottr::bookdown_to_leanpub() ``` -By default, `leanbuild` will re-run a `bookdown::render_book("index.Rmd")` rendering of your chapters first before converting the files to the Leanpub ready format. -However, if you wish to skip this step, you can set `render = FALSE` when running the `leanbuild::bookdown_to_leanpub()` function. +By default, `ottr` will re-run a `bookdown::render_book("index.Rmd")` rendering of your chapters first before converting the files to the Leanpub ready format. +However, if you wish to skip this step, you can set `render = FALSE` when running the `ottr::bookdown_to_leanpub()` function. ## About the Book.txt file: Leanpub requires a [`Book.txt`](https://leanpub.com/lfm/read#leanpub-auto-booktxt-sampletxt-and-manuscript-files) file to know what order the chapters/quizzes should be published. -By default, your `Book.txt` file will _not_ be autogenerated but `leanbuild` will look in your given directory for an existing `Book.txt` file which it will copy over to the output directory. +By default, your `Book.txt` file will _not_ be autogenerated but `ottr` will look in your given directory for an existing `Book.txt` file which it will copy over to the output directory. -You can create a `Book.txt` file manually, or if your quizzes and chapters are numbered, `leanbuild` can create the `Book.txt` file based on the numbers going from low to high and quizzes following chapters of the same number. +You can create a `Book.txt` file manually, or if your quizzes and chapters are numbered, `ottr` can create the `Book.txt` file based on the numbers going from low to high and quizzes following chapters of the same number. (e.g. `quiz_03.md` will be placed after `03-some_chapter_file.Rmd`). -To have `leanbuild` attempt to autogenerate this file, set `make_book_txt` to `TRUE`. +To have `ottr` attempt to autogenerate this file, set `make_book_txt` to `TRUE`. ```{r} -leanbuild::bookdown_to_leanpub(make_book_txt = TRUE) +ottr::bookdown_to_leanpub(make_book_txt = TRUE) ``` -If no `Book.txt` file is found and `make_book_txt` is set to `FALSE` (this is the default setting), `leanbuild` will fail. +If no `Book.txt` file is found and `make_book_txt` is set to `FALSE` (this is the default setting), `ottr` will fail. -A leanbuild autogenerated `Book.txt` file might look something like this: +A ottr autogenerated `Book.txt` file might look something like this: ``` index.Rmd 01-chapter.Rmd @@ -117,26 +117,26 @@ Also note that any `index.Rmd` will always be placed first and any `about.Rmd` f ## Setting up quizzes: -By default, leanbuild will look for a folder called `quizzes/` to find your quiz `.md` files. +By default, ottr will look for a folder called `quizzes/` to find your quiz `.md` files. If your quizzes are located somewhere else, you will need to use the `quiz_dir` argument to specify that: ```{r} -leanbuild::bookdown_to_leanpub(quiz_dir = "some_directory") +ottr::bookdown_to_leanpub(quiz_dir = "some_directory") ``` ## About the output files Leanpub's Github writing mode will look for a directory called `manuscript` to publish from. -You should not edit the files in `manuscript/` by hand since a re-run of `leanbuild` will cause your changes to be overwritten. +You should not edit the files in `manuscript/` by hand since a re-run of `ottr` will cause your changes to be overwritten. ## Adding footer text: -If there is text you would like added to the end of each chapter (like a link to a feedback survey for example), you can supply a character string to the `footer_text`argument in the main `leanbuild::bookdown_to_leanpub()` function. +If there is text you would like added to the end of each chapter (like a link to a feedback survey for example), you can supply a character string to the `footer_text`argument in the main `ottr::bookdown_to_leanpub()` function. ```{r} # Set up a character string survey_link <- "Please provide any feedback you have in [this survey](www.some_link.org)" # Supply the footer text in the main function -leanbuild::bookdown_to_leanpub(footer_text = survey_link) +ottr::bookdown_to_leanpub(footer_text = survey_link) ``` diff --git a/docs/404.html b/docs/404.html index 4fb5e31..7881978 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,7 +6,7 @@ -Page not found (404) • leanbuild +Page not found (404) • ottr @@ -70,7 +70,7 @@ - leanbuild + ottr 0.1.2 @@ -104,7 +104,7 @@