Skip to content

Commit 1146512

Browse files
committed
Switch writers to use the new @examplesTempdir
1 parent 4b194f0 commit 1146512

File tree

7 files changed

+43
-36
lines changed

7 files changed

+43
-36
lines changed

DESCRIPTION

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,29 @@ Title: Download and Extract Shinylive Applications
33
Version: 0.1.0
44
Authors@R:
55
person("James Joseph", "Balamuta", , "[email protected]", role = c("aut", "cre"))
6-
Description: Peeks into Quarto documents and standalone Shinylive applications
7-
to download and extract their Shiny application source. Handles the
8-
extraction of application files from app.json format into a directory structure.
6+
Description: Peek into published 'Shinylive' applications by retrieving their source code.
7+
Supports downloading and extracting 'Shiny' application source from
8+
'Quarto' documents and standalone 'Shinylive' applications.
99
URL: https://r-pkg.thecoatlessprofessor.com/peeky/, https://github.com/coatless-rpkg/peeky
1010
BugReports: https://github.com/coatless-rpkg/peeky/issues
11+
License: AGPL (>= 3)
1112
Imports:
1213
jsonlite,
1314
httr,
1415
rvest,
1516
fs,
1617
cli
17-
License: AGPL (>= 3)
18-
Encoding: UTF-8
19-
Roxygen: list(markdown = TRUE)
20-
RoxygenNote: 7.3.2
2118
Suggests:
2219
knitr,
2320
rmarkdown,
2421
quarto,
2522
withr,
26-
testthat (>= 3.0.0)
23+
testthat (>= 3.0.0),
24+
rocleteer
25+
Encoding: UTF-8
26+
Roxygen: list(markdown = TRUE, packages = c("rocleteer"))
27+
RoxygenNote: 7.3.2
2728
VignetteBuilder: quarto
2829
Config/testthat/edition: 3
30+
Remotes:
31+
coatless-rpkg/rocleteer

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ S3method(print,standalone_shinylive_app)
55
export(peek_quarto_shinylive_app)
66
export(peek_shinylive_app)
77
export(peek_standalone_shinylive_app)
8+
export(write_apps_to_dirs)
9+
export(write_apps_to_quarto)
10+
export(write_file_content)
11+
export(write_standalone_shinylive_app)

R/writers.R

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#' Parent directories in the file path are automatically created if they don't
3131
#' exist using `fs::dir_create()` with `recurse = TRUE`.
3232
#'
33-
#' @examples
34-
#' \dontrun{
33+
#' @export
34+
#' @examplesTempdir
3535
#' # Writing a text file
3636
#' write_file_content(
3737
#' content = "library(shiny)\n\nui <- fluidPage()",
@@ -45,9 +45,6 @@
4545
#' "DUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
4646
#' )
4747
#' write_file_content(b64img, "test.png", type = "binary")
48-
#' }
49-
#'
50-
#' @keywords internal
5148
write_file_content <- function(content, file_path, type = "text") {
5249
# Ensure parent directory exists
5350
parent_dir <- dirname(file_path)
@@ -136,9 +133,8 @@ write_file_content <- function(content, file_path, type = "text") {
136133
#' - Properly closes the code block
137134
#' 3. Writes the complete document to the specified path
138135
#'
139-
#' @keywords internal
140-
#' @examples
141-
#' \dontrun{
136+
#' @export
137+
#' @examplesTempdir
142138
#' # Example apps list structure
143139
#' apps <- list(
144140
#' list(
@@ -158,8 +154,6 @@ write_file_content <- function(content, file_path, type = "text") {
158154
#' )
159155
#'
160156
#' write_apps_to_quarto(apps, "applications.qmd")
161-
#' }
162-
#'
163157
#' @seealso
164158
#' * [write_apps_to_dirs()] for alternative directory output format
165159
write_apps_to_quarto <- function(apps, qmd_path) {
@@ -293,9 +287,8 @@ write_apps_to_quarto <- function(apps, qmd_path) {
293287
#' - [padding_width()] for directory number padding calculation
294288
#' - [write_apps_to_quarto()] for alternative Quarto output format
295289
#'
296-
#' @keywords internal
297-
#' @examples
298-
#' \dontrun{
290+
#' @export
291+
#' @examplesTempdir
299292
#' # Example apps list structure
300293
#' apps <- list(
301294
#' list(
@@ -323,7 +316,6 @@ write_apps_to_quarto <- function(apps, qmd_path) {
323316
#' )
324317
#'
325318
#' write_apps_to_dirs(apps, "extracted_apps")
326-
#' }
327319
write_apps_to_dirs <- function(apps, base_dir) {
328320
fs::dir_create(base_dir, recurse = TRUE)
329321

@@ -426,8 +418,8 @@ write_apps_to_dirs <- function(apps, base_dir) {
426418
#' - [create_standalone_shinylive_app()] for object creation
427419
#' - [validate_app_json()] for JSON data validation
428420
#'
429-
#' @examples
430-
#' \dontrun{
421+
#' @export
422+
#' @examplesTempdir
431423
#' # Example JSON data structure
432424
#' json_data <- list(
433425
#' list(
@@ -447,8 +439,6 @@ write_apps_to_dirs <- function(apps, base_dir) {
447439
#' "https://example.com/app.json",
448440
#' "my_app"
449441
#' )
450-
#' }
451-
#' @keywords internal
452442
write_standalone_shinylive_app <- function(json_data, source_url, output_dir = "converted_shiny_app") {
453443
# Create output directory
454444
fs::dir_create(output_dir, recurse = TRUE)

man/write_apps_to_dirs.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/write_apps_to_quarto.Rd

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/write_file_content.Rd

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/write_standalone_shinylive_app.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)