Skip to content

Commit

Permalink
update example for get pages and add export to screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kweav committed Jul 9, 2024
1 parent 4f85a8c commit edddb94
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export(gs_png_download)
export(gs_png_url)
export(include_slide)
export(make_embed_markdown)
export(make_screenshots)
export(output_destination)
export(parse_q_tag)
export(parse_quiz)
Expand Down
2 changes: 1 addition & 1 deletion R/get_pages_url.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#'
#' usethis::create_github_token()
#'
#' get_chapters("jhudsl/Documentation_and_Usability")
#' get_pages_url("jhudsl/Documentation_and_Usability")
#' }
get_pages_url <- function(repo_name,
git_pat = NULL,
Expand Down
7 changes: 7 additions & 0 deletions R/screenshot.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#' A function to make screenshots from an OTTR bookdown website
#' @description This function creates screenshots of course chapters that are stored in a created output directory
#'
#' @param git_pat required argument; a Git secret -- see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens for more info
#' @param repo required argument; GitHub repository name, e.g., jhudsl/OTTR_Template
#' @param output_dir default is "resources/chapt_screen_images"; Output directory where the chapter's screen images should be stored. For OTTR courses, don't change this unless you've changed the downstream functions accordingly.
#' @param base_url default is NULL; rendered bookdown URL where screenshots are taken from, if NULL, the function will use the repo_name and and git_pat to find the base_url
#'
#' @return the file path for file where chapter urls are saved
#'
#' @import dplyr
#' @importFrom webshot2 webshot
#' @importFrom magrittr %>%
#' @importFrom rprojroot find_root has_dir
#'
#' @author Candace Savonen
#'
#' @export
#'
#' @examples \dontrun{
#'
#' make_screenshots(Sys.getenv("secrets.GH_PAT"), "jhudsl/OTTR_Template")
Expand Down
2 changes: 1 addition & 1 deletion man/get_pages_url.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit edddb94

Please sign in to comment.