Skip to contents

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, see snaps2fig(). You can also use snaps2md() 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:

Roxygen: list(packages =  "crow")

If you already have other arguments specified for Roxygen, just add packages list element.

Screenshots from Tests

name: bins, variant: linux Screenshot