Skip to content

Commit

Permalink
refactor tex-writing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Nov 29, 2024
1 parent 747163b commit 8d3aa68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
16 changes: 3 additions & 13 deletions R/shiny2screenshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,9 @@ snaps2rd <- function(test_file = character(),
variant = variant,
fps = fps
)
glue::glue_collapse(
c(
glue::glue("{{name: \\code{{{name}}}, variant: \\code{{{variant}}}"),
paste0(
"\\figure{",
path,
"}{options: width='100\\%' alt=",
snap_alt_text(),
"}}",
collapse = ""
)
),
sep = " "
glue_latex(
"name: \\code{[name]}, variant: \\code{[variant]}
\\figure{[path]}{options: width='100\\%' alt=[snap_alt_text()]}"
)
}

Expand Down
9 changes: 6 additions & 3 deletions tests/testthat/_snaps/shiny2screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
Output
\section{Screenshots from Tests}{
\if{html}{
{name: \code{bins}, variant: \code{linux} \figure{crow_screenshots/helpers/bins.gif}{options: width='100\%' alt=Screenshot from App}}
name: \code{bins}, variant: \code{linux}
\figure{crow_screenshots/helpers/bins.gif}{options: width='100\%' alt=Screenshot from App}
}
\if{latex}{
Screenshots cannot be shown in this output format.
Expand All @@ -79,8 +80,10 @@
Output
\section{Screenshots from Tests}{
\if{html}{
{name: \code{bins}, variant: \code{linux} \figure{crow_screenshots/helpers/bins.gif}{options: width='100\%' alt=Screenshot from App}}
{name: \code{bins}, variant: \code{mac} \figure{crow_screenshots/helpers/bins.gif}{options: width='100\%' alt=Screenshot from App}}
name: \code{bins}, variant: \code{linux}
\figure{crow_screenshots/helpers/bins.gif}{options: width='100\%' alt=Screenshot from App}
name: \code{bins}, variant: \code{mac}
\figure{crow_screenshots/helpers/bins.gif}{options: width='100\%' alt=Screenshot from App}
}
\if{latex}{
Screenshots cannot be shown in this output format.
Expand Down

0 comments on commit 8d3aa68

Please sign in to comment.