Skip to content

Commit

Permalink
Merge pull request #98 from jhudsl/cansavvy/ottrpal
Browse files Browse the repository at this point in the history
ottr -> ottrpal
  • Loading branch information
cansavvy authored Feb 15, 2022
2 parents 3f867de + e10e53c commit 1018848
Show file tree
Hide file tree
Showing 76 changed files with 393 additions and 393 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/problem-report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Problem Report
about: Create a report to help improve ottr and its documentation
about: Create a report to help improve ottrpal and its documentation
title: problem
labels: bug
assignees: cansavvy
Expand All @@ -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 `ottr`?
What does the render look like versus what did you write and supply to `ottrpal`?

**Additional context**
Add any other context about the problem here.
26 changes: 13 additions & 13 deletions .github/workflows/update-leanpub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: Update Leanpub Upon Merge

# Triggers the workflow AFTER changes to ottr have been merged
# Triggers the workflow AFTER changes to ottrpal have been merged
on:
workflow_dispatch:
push:
Expand All @@ -24,36 +24,36 @@ jobs:
repository: jhudsl/OTTR_Quizzes
token: ${{ secrets.GH_PAT }}

# Copy over the latest ottr and use that for the run
- name: Get latest ottr
# Copy over the latest ottrpal and use that for the run
- name: Get latest ottrpal
run: |
sudo apt-get install -y --no-install-recommends subversion
# Copy over the latest ottr build
svn export https://github.com/${GITHUB_REPOSITORY}.git/branches/master ottr/
# Copy over the latest ottrpal build
svn export https://github.com/${GITHUB_REPOSITORY}.git/branches/master ottrpal/
# Run leanpub rendering
- name: Run ottr::bookdown_to_leanpub
- name: Run ottrpal::bookdown_to_leanpub
run: |
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
Rscript -e "devtools::load_all('ottrpal'); ottrpal::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('ottrpal'); ottrpal::render_coursera(convert_quizzes = TRUE)"
rm -r ottrpal
- name: Create PR with newly rendered docs files
uses: peter-evans/create-pull-request@v3
id: cpr
with:
token: ${{ secrets.GH_PAT }}
commit-message: Show latest ottr changes
commit-message: Show latest ottrpal changes
signoff: false
branch: auto_copy_rendered_files
delete-branch: true
title: 'GHA: Automated transfer re-render with ottr update'
title: 'GHA: Automated transfer re-render with ottrpal update'
body: |
### Description:
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.
This PR has changes to this repository's files using the latest ottrpal package changes!
If they don't look right, file an issue on the ottrpal package: https://github.com/jhudsl/ottrpal/issuesand do not merge.
labels: |
automated
reviewers: $GITHUB_ACTOR
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: ottr
Package: ottrpal
Version: 0.1.2
Title: Tools for Creating Automated Courses
Description: Leverages the 'bookdown' package and other tools to create courses
Expand Down Expand Up @@ -49,6 +49,6 @@ Remotes: jhudsl/text2speech,
ByteCompile: true
Type: Package
VignetteBuilder: knitr
URL: https://github.com/jhudsl/ottr
BugReports: https://github.comjhudsl/ottr/issues
URL: https://github.com/jhudsl/ottrpal
BugReports: https://github.comjhudsl/ottrpal/issues
RoxygenNote: 7.1.2
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

ottr Copyright (C) 2021 John Muschelli
ottrpal 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.
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# ottr 0.1.0
# ottrpal 0.1.0

* Added a `NEWS.md` file to track changes to the package.
8 changes: 4 additions & 4 deletions R/bookdown_to_leanpub.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @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 [ottr::bookdown_to_book_txt()] be run
#' @param make_book_txt Should [ottrpal::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,
Expand Down Expand Up @@ -144,7 +144,7 @@ bookdown_to_leanpub <- function(path = ".",
#' @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 [ottr::bookdown_to_book_txt()] be run
#' @param make_book_txt Should [ottrpal::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,
Expand All @@ -159,9 +159,9 @@ bookdown_to_leanpub <- function(path = ".",
#'
#' @examples \dontrun{
#'
#' ottr::bookdown_to_embed_leanpub(base_url = "")
#' ottrpal::bookdown_to_embed_leanpub(base_url = "")
#'
#' ottr::bookdown_to_embed_leanpub(chapt_img_key = "chapter_urls.tsv")
#' ottrpal::bookdown_to_embed_leanpub(chapt_img_key = "chapter_urls.tsv")
#'
#' }

Expand Down
2 changes: 1 addition & 1 deletion R/coursera.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ render_without_toc <- function(output_dir = file.path("docs", "no_toc"),
toc_close_css <- file.path(root_dir, "assets", "toc_close.css")

if (!file.exists(toc_close_css)) {
download.file("https://raw.githubusercontent.com/jhudsl/ottr/master/inst/extdata/toc_close.css",
download.file("https://raw.githubusercontent.com/jhudsl/ottrpal/master/inst/extdata/toc_close.css",
destfile = toc_close_css
)
}
Expand Down
10 changes: 5 additions & 5 deletions R/example_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ good_quiz_path <- function() {
list.files(
pattern = "quiz_good.md$",
recursive = TRUE,
system.file("extdata", package = "ottr"),
system.file("extdata", package = "ottrpal"),
full.names = TRUE
)
}
Expand All @@ -27,7 +27,7 @@ bad_quiz_path <- function() {
list.files(
pattern = "quiz_bad.md$",
recursive = TRUE,
system.file("extdata", package = "ottr"),
system.file("extdata", package = "ottrpal"),
full.names = TRUE
)
}
Expand All @@ -40,11 +40,11 @@ bad_quiz_path <- function() {
#' @importFrom fs dir_copy
#' @examples
#' # Run this to get the files we need
#' example_files <- ottr::example_repo_setup()
#' example_files <- ottrpal::example_repo_setup()
example_repo_setup <- function(dest_dir = ".") {
bookdown_path <- list.files(
pattern = "_bookdown.yml$",
system.file("extdata/", package = "ottr"),
system.file("extdata/", package = "ottrpal"),
full.names = TRUE
)

Expand All @@ -65,7 +65,7 @@ example_repo_setup <- function(dest_dir = ".") {
#' @examples
#'
#' # Run this to get the files we need
#' example_files <- ottr::example_repo_setup()
#' example_files <- ottrpal::example_repo_setup()
#'
#' # Run this to delete them
#' example_repo_cleanup(files_to_remove = basename(example_files))
Expand Down
16 changes: 8 additions & 8 deletions R/quiz.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ extract_quiz <- function(quiz_lines) {

#' Check Quiz Attributes
#'
#' @param quiz_specs The output from [ottr::parse_quiz].
#' @param quiz_specs The output from [ottrpal::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
#'
Expand Down Expand Up @@ -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 [ottr::check_all_questions] for all questions.
#' This is ran automatically by [ottrpal::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 [ottr::parse_quiz_df] and dplyr::group_split(question).
#' @param question_df a data.frame obtained from [ottrpal::parse_quiz_df] and dplyr::group_split(question).
#' @param quiz_name inherited from parse
#' @param verbose print diagnostic messages
#'
Expand Down Expand Up @@ -361,14 +361,14 @@ check_quiz_question_attributes <- function(question_df,

#' Check all quiz questions
#'
#' Takes output from [ottr::parse_quiz] and runs checks on each question in a quiz by calling [ottr::check_question] for each question.
#' Takes output from [ottrpal::parse_quiz] and runs checks on each question in a quiz by calling [ottrpal::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 [ottr::parse_quiz].
#' @param quiz_specs quiz_specs which is output from [ottrpal::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 [ottr::check_question] with messages/warnings regarding each question and each check.
#' @return A list of the output from [ottrpal::check_question] with messages/warnings regarding each question and each check.
#'
#' @export check_all_questions
#'
Expand Down Expand Up @@ -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 [ottr::check_all_questions] and run for each question.
#' Is called by [ottrpal::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
Expand Down Expand Up @@ -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 [ottr::check_all_quizzes].
#' @param quiz_dir A path to a directory full of quizzes that should all be checked with [ottrpal::check_all_quizzes].
#' @param verbose print diagnostic messages
#' @param write_report TRUE/FALSE save warning report to a CSV file?
#'
Expand Down
2 changes: 1 addition & 1 deletion R/remove_yaml.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partition_yaml_front_matter <- function(input_lines) {
#' @export
#'
#' @examples
#' file <- system.file("extdata/00_template.Rmd", package = "ottr")
#' file <- system.file("extdata/00_template.Rmd", package = "ottrpal")
#' out <- remove_yaml_header(file)
#' head(out)
remove_yaml_header <- function(file) {
Expand Down
2 changes: 1 addition & 1 deletion R/set_up.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,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 [ottr::bookdown_to_book_txt()] be run
#' @param make_book_txt Should [ottrpal::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,
Expand Down
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ output: github_document
---

<!-- badges: start -->
[![R-CMD-check](https://github.com/jhudsl/ottr/workflows/R-CMD-check/badge.svg)](https://github.com/jhudsl/ottr/actions)
[![R-CMD-check](https://github.com/jhudsl/ottrpal/workflows/R-CMD-check/badge.svg)](https://github.com/jhudsl/ottrpal/actions)
<!-- badges: end -->

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand All @@ -16,17 +16,17 @@ knitr::opts_chunk$set(
)
```

# ottr Package:
# ottrpal Package:

The goal of `ottr` is to provide tools to convert from Bookdown content to Leanpub content and do some checks.
The goal of `ottrpal` is to provide tools to convert from Bookdown content to Leanpub content and do some checks.

## Installation

You can install `ottr` from GitHub with:
You can install `ottrpal` from GitHub with:

```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("jhudsl/ottr")
remotes::install_github("jhudsl/ottrpal")
```


Expand All @@ -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}
ottr::bookdown_to_leanpub()
ottrpal::bookdown_to_leanpub()
```

By default the output files will be sent to a `manuscript` folder which is what Leanpub looks for.
Expand Down
Loading

0 comments on commit 1018848

Please sign in to comment.