Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Nov 29, 2024
1 parent 77491a0 commit 747163b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
15 changes: 9 additions & 6 deletions R/shiny2screenshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,16 @@ glue_latex <- function(..., .envir = parent.frame()) {
#' @export
format.rd_section_crowInsertSnaps <- function(x, ...) {
inner <- glue::glue_collapse(x$value, sep = "\n")
# appease check
inner
glue_latex(
"\\section{Screenshots from Tests}
\\if{html}{
[inner]
}
\\if{latex}{
Screenshots cannot be shown in this output format.
"\\section{Screenshots from Tests}{
\\if{html}{
[inner]
}
\\if{latex}{
Screenshots cannot be shown in this output format.
}
}"
)
}
Expand Down
28 changes: 15 additions & 13 deletions tests/testthat/_snaps/shiny2screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,28 @@
Code
topic$get_section("crowInsertSnaps")
Output
\section{Screenshots from Tests}
\if{html}{
name: \code{bins}, variant: \code{linux}
}
\if{latex}{
Screenshots cannot be shown in this output format.
\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}}
}
\if{latex}{
Screenshots cannot be shown in this output format.
}
}

# roxy_tag_crowInsertSnaps: can be formatted with multiple tags joined

Code
topic$get_section("crowInsertSnaps")
Output
\section{Screenshots from Tests}
\if{html}{
name: \code{bins}, variant: \code{linux}
name: \code{bins}, variant: \code{mac}
}
\if{latex}{
Screenshots cannot be shown in this output format.
\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}}
}
\if{latex}{
Screenshots cannot be shown in this output format.
}
}

# snaps2fig and friends work: writes out markdown syntax
Expand Down

0 comments on commit 747163b

Please sign in to comment.