Skip to content

Commit

Permalink
Fix order of steps
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Feb 23, 2022
1 parent c13e953 commit 54654d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/make_screenshots.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ if (!dir.exists(output_folder)) {

if (is.null(opt$base_url)) {
base_url <- cow::get_pages_url(repo_name = opt$repo, git_pat = opt$git_pat)
base_url <- gsub("/$", "", base_url)
}

chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc/"))


file_names <- lapply(chapt_df$url, function(url) {
file_name <- gsub(".html", ".png", file.path(output_folder, basename(url)))
# Get rid of special characters
file_name <- gsub(":|?|!|\\'", "", file_name)
webshot::webshot(url, file_name)
file_name <- gsub(":|?|!|\\'", "", file_name)
message(paste("Screenshot saved:", file_name))
return(file_name)
})
Expand Down

0 comments on commit 54654d5

Please sign in to comment.