-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cansavvy/reorg
- Loading branch information
Showing
15 changed files
with
113 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,6 @@ Imports: | |
rvest, | ||
stringr, | ||
xml2, | ||
quarto, | ||
yaml | ||
Suggests: | ||
remotes, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
test_that("Tocless render for Quarto", { | ||
test_that("Create Leanpub IFrames for Quarto", { | ||
|
||
dir <- download_ottr_template(dir = "inst/extdata", type = "quarto") | ||
dir <- download_ottr_template(dir = ".", type = "quarto") | ||
|
||
# render_without_toc() | ||
quarto::quarto_render(dir, | ||
metadata = list(sidebar = F, toc = F), | ||
quarto_args = c('--output-dir', 'docs/no_toc/')) | ||
|
||
# TODO: This should be functionalized and incorporated into the package | ||
# curl -o make_screenshots.R https://raw.githubusercontent.com/jhudsl/ottr-reports/main/scripts/make_screenshots.R | ||
# chapt_urls=$(Rscript --vanilla make_screenshots.R \ | ||
# --git_pat ${{ secrets.GH_PAT }} \ | ||
# --repo $GITHUB_REPOSITORY \ | ||
# chapt_urls=$(Rscript --vanilla make_screenshots.R | ||
# --git_pat sys.getEnv("GH_PAT") | ||
# --repo fhdsl/OTTR_Quarto | ||
# --output_dir resources/chapt_screen_images) | ||
unlink(dir, recursive = TRUE) | ||
}) | ||
|
||
## TEST HERE: | ||
# 1. Does each chapter have screenshot? | ||
# 2. Is the file 'resources/chapt_screen_images/chapter_urls.tsv' made fresh? | ||
# 2. Does chapter_urls.tsv file made have columns with information that are labeled "url", "chapt_title" and "img_path" | ||
|
||
test_that("Create Leanpub IFrames for Quarto", { | ||
# ottrpal::bookdown_to_embed_leanpub( | ||
# render = FALSE, \ | ||
# chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ | ||
# make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'), \ | ||
# quiz_dir = NULL) | ||
#ottrpal::bookdown_to_embed_leanpub( | ||
# render = FALSE, | ||
# chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', | ||
# make_book_txt = TRUE, | ||
# quiz_dir = NULL) | ||
|
||
## TEST HERE: | ||
# 1. Did each chapter get a md in the manuscript folder? | ||
# 2. Does each md link to the appropriate sceenshot? | ||
# 3. Did the screenshot file path that's in the md lead to the appropriate file path? | ||
|
||
# ottrpal::bookdown_to_embed_leanpub( | ||
# render = FALSE, \ | ||
# chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ | ||
# make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}')) | ||
unlink(dir, recursive = TRUE) | ||
file.remove(paste0(dir, ".zip")) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,54 @@ | ||
test_that("Rmd Rendering", { | ||
dir <- download_ottr_template(dir = ".", type = "rmd") | ||
rmd_dir <- download_ottr_template(dir = ".", type = "rmd") | ||
|
||
bookdown::render_book("OTTR_Template-main") | ||
unlink(dir) | ||
dir.exists(rmd_dir) | ||
|
||
bookdown::render_book(rmd_dir) | ||
|
||
unlink(rmd_dir, recursive = TRUE) | ||
file.remove(paste0(rmd_dir, ".zip")) | ||
}) | ||
|
||
test_that("Quarto Rendering", { | ||
dir <- download_ottr_template(dir = ".", type = "quarto") | ||
quarto_dir <- download_ottr_template(dir = ".", type = "quarto") | ||
|
||
dir.exists(quarto_dir) | ||
|
||
quarto::quarto_render(dir) | ||
quarto::quarto_render(dir, | ||
# Render it normal | ||
quarto::quarto_render(quarto_dir, as_job = FALSE) | ||
|
||
# Render it a different way | ||
quarto::quarto_render(quarto_dir, | ||
metadata = list(sidebar = F, toc = F), | ||
quarto_args = c("--output-dir", "docs/no_toc/") | ||
quarto_args = c("--output-dir", "docs/no_toc/"), | ||
as_job = FALSE | ||
|
||
) | ||
unlink(dir) | ||
unlink(quarto_dir, recursive = TRUE) | ||
file.remove(paste0(quarto_dir, ".zip")) | ||
}) | ||
|
||
test_that("Rmd Website Rendering", { | ||
dir <- download_ottr_template(dir = ".", type = "rmd_website") | ||
rmd_web_dir <- download_ottr_template(dir = ".", type = "rmd_website") | ||
|
||
rmarkdown::clean_site(dir, preview = FALSE) | ||
dir.exists(rmd_web_dir) | ||
|
||
rmarkdown::render_site(dir) | ||
|
||
unlink(dir) | ||
rmarkdown::clean_site(rmd_web_dir, preview = FALSE) | ||
|
||
rmarkdown::render_site(rmd_web_dir) | ||
|
||
unlink(rmd_web_dir, recursive = TRUE) | ||
file.remove(paste0(rmd_web_dir, ".zip")) | ||
}) | ||
|
||
|
||
test_that("Quarto Website Rendering", { | ||
dir <- download_ottr_template(dir = ".", type = "quarto_website") | ||
quarto_web_dir <- download_ottr_template(dir = ".", type = "quarto_website") | ||
|
||
dir.exists(quarto_web_dir) | ||
|
||
quarto::quarto_render(quarto_web_dir, as_job = FALSE) | ||
|
||
quarto::quarto_render(dir) | ||
|
||
unlink(dir) | ||
unlink(quarto_web_dir, recursive = TRUE) | ||
file.remove(paste0(quarto_web_dir, ".zip")) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
|
||
test_that("Tocless render for Rmd", { | ||
# render_without_toc() | ||
test_that("Create Leanpub IFrames for Rmd", { | ||
|
||
dir <- download_ottr_template(dir = ".", type = "rmd") | ||
|
||
dir.exists(dir) | ||
|
||
bookdown::render_book(dir) | ||
|
||
# TODO: This should be functionalized and incorporated into the package | ||
# curl -o make_screenshots.R https://raw.githubusercontent.com/jhudsl/ottr-reports/main/scripts/make_screenshots.R | ||
# chapt_urls=$(Rscript --vanilla make_screenshots.R \ | ||
# --git_pat ${{ secrets.GH_PAT }} \ | ||
# --repo $GITHUB_REPOSITORY \ | ||
# Rscript --vanilla make_screenshots.R | ||
# --git_pat sys.getEnv("GH_PAT") | ||
# --repo fhdsl/OTTR_Template | ||
# --output_dir resources/chapt_screen_images) | ||
|
||
unlink("dir", recursive = TRUE) | ||
}) | ||
|
||
|
||
test_that("Create Leanpub IFrames for Rmd", { | ||
|
||
dir <- download_ottr_template(dir = ".", type = "rmd") | ||
## TEST HERE: | ||
# 1. Does each chapter have screenshot? | ||
# 2. Is the file 'resources/chapt_screen_images/chapter_urls.tsv' made fresh? | ||
# 2. Does chapter_urls.tsv file made have columns with information that are labeled "url", "chapt_title" and "img_path" | ||
|
||
# ottrpal::bookdown_to_embed_leanpub( | ||
# render = FALSE, \ | ||
# chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ | ||
# make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}'), \ | ||
# quiz_dir = NULL) | ||
#ottrpal::bookdown_to_embed_leanpub( | ||
# render = FALSE, | ||
# chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', | ||
# make_book_txt = TRUE, | ||
# quiz_dir = NULL) | ||
|
||
# ottrpal::bookdown_to_embed_leanpub( | ||
# render = FALSE, \ | ||
# chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \ | ||
# make_book_txt = as.logical('${{needs.yaml-check.outputs.make_book_txt}}')) | ||
## TEST HERE: | ||
# 1. Did each chapter get a md in the manuscript folder? | ||
# 2. Does each md link to the appropriate sceenshot? | ||
# 3. Did the screenshot file path that's in the md lead to the appropriate file path? | ||
|
||
unlink(dir, recursive = TRUE) | ||
file.remove(paste0(dir, ".zip")) | ||
}) |