Provides new roxygen2 tags to add screenshots to shiny app documentation.
Usage
# @crowExamplesShiny ${1:# example code}
# @crowInsertSnaps
# ${1:test_file}
# ${2:name}
# ${3:auto_numbered}
# ${4:variant}
# ${5:fps}
Details
Because starting a shiny app does not return,
it cannot be included as an #' @examples
,
or must wrapped in \dontrun
.
But for quick reference, a screenshot or gif of a shiny app
are still helpful for the reader of your documentation.
@crowExamplesShiny$ {1:# example code}
R code which returns a shiny app. A screenshot of the shiny app is added to the documentation, along with the code required to create the screenshot and launch the app interactively. Wraps @examples.
@crowInsertSnaps ${1:test_file} ${2:name} ${3:auto_numbered} ${4:variant} ${5:fps}
Instead of re-creating screenshots, insert reused screenshots created by shinytest2 snapshot testing. For arguments and defaults, seesnaps2fig()
. You can also usesnaps2md()
directly, without a custom tag.
Usage in Packages
If you want to use these tags in your own packages, you need let roxygen2 know about crow.
To do that, append this line to your DESCRIPTION
:
: list(packages = "crow") Roxygen
If you already have other arguments specified for Roxygen,
just add packages
list element.
See also
Other screenshot:
examples_app()
,
get_screenshot_args_attr()
,
get_screenshot_from_app()
,
get_screenshot_from_snaps
,
glue_regexp_snaps()