Created
May 26, 2017 19:00
-
-
Save seankross/362bc01d5661b7a1d03a7faa6ed7aa54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @importFrom shiny | |
#' @import miniUI | |
codefinch_app <- function(){ | |
ui <- miniPage( | |
gadgetTitleBar("Codefinch: Tweet Your Code", | |
right = miniTitleBarButton("tweet_it", "Send Tweet", primary = TRUE)), | |
miniContentPanel( | |
imageOutput("code_png", width = "100%", height = "100%") | |
# 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)) | |
}) | |
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