Skip to content

Instantly share code, notes, and snippets.

@seankross
Created May 26, 2017 19:05
Show Gist options
  • Select an option

  • Save seankross/1e38b665ead98d8c2d2c39e62df63743 to your computer and use it in GitHub Desktop.

Select an option

Save seankross/1e38b665ead98d8c2d2c39e62df63743 to your computer and use it in GitHub Desktop.
#' @importFrom shiny
#' @import miniUI
codefinch_app <- function(){
ui <- miniPage(
gadgetTitleBar("Codefinch: Tweet Your Code",
right = miniTitleBarButton("tweet_it", "Send Tweet", primary = TRUE)),
miniContentPanel(scrollable=FALSE,
fillCol(imageOutput("code_png"))
# fillRow(flex = c(2, 3),
# fillCol(
# textAreaInput("status", label = NULL, width = "100%", height = "100%",
# resize = "both"),
# textOutput("chars"),
# checkboxInput("gist_url", "Include Gist URL?"),
# selectInput("highlight", "Select Highlight", choices = c(
# "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn","haddock"
# ))
# ),
# fillCol(imageOutput("code_png"))
# )
# fillCol(flex = c(5, 2),
# imageOutput("code_png", height = "100%"),
# fillRow(flex = c(2, 1),
# fillCol(textAreaInput("status", label = NULL, width = "100%", height = "100%",
# resize = "both"),
# fillRow(textOutput("chars"),
# checkboxInput("gist_url", "Include Gist URL?"))
# ),
# selectInput("highlight", "Select Highlight", choices = c(
# "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn","haddock"
# ))
# )
# )
)
)
server <- function(input, output){
output$code_png <- renderImage({
list(src = create_image(highlight = input$highlight), width = "100%")
})
output$chars <- renderText({
140 - nchar(input$status)
})
}
runGadget(ui, server, viewer = paneViewer())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment