knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of shinyBarcode
is to wrap the JsBarcode library, written by Johan Lindell, for R. This enables rendering of barcodes in R Markdown and Shiny. This enables generating receipts in markdown, which can compiled to HTML with rmarkdown
, and then printed using Google Cloud Print using googlePrintr
.
You can install CannaBarcode from github with:
# install.packages("devtools") devtools::install_github("CannaData/shinyBarcode")
```{R, eval = FALSE} library(shiny) library(CannaBarcode)
ui <- fluidPage( # must include javascript dependencies CannaBarcode::includeJsBarcode(cdn = TRUE), numericInput("value", "Input a positive integer", 8675309, 0, 1000000), CannaBarcode::barcodeOutput("barcode") )
server <- function(input, output, session) { output$barcode <- CannaBarcode::renderBarcode( input$value ) }
shinyApp(ui = ui, server = server) ```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.