Reputation: 332
Wanted to check if I can convert server.R file into HTML. Sample server file below
server.R
library(shiny)
shinyServer(function(input, output) {
output$greeting <- renderText({
paste0("Hello, ", input$name, "!")
})
print(getwd())
})
Upvotes: 0
Views: 31
Reputation: 7350
You can, try shinyAce
. See my example below. It not only gives you the nice html box around it and also r syntax highlight.
library(shiny)
library(shinyAce)
# load your server file for the right path
server_text <- readLines("server.R")
ui <- fluidPage(
aceEditor(outputId = "show_server", value = server_text, readOnly = TRUE, mode = "r")
)
server <- function(input, output) {}
shinyApp(ui = ui, server = server)
Upvotes: 1