I have this shiny app:
library(shiny)
# Define UI
ui <- fluidPage(
tags$head(
tags$style(
HTML(
"
.form-control {
border-radius: 4px 4px 4px 4px;
}
#pythonCode, #javaCode {
font-size: 14px;
width: 300px;
height: 300px;
max-width: 100%;
padding: 6px 12px;
white-space: pre-wrap;
}
"
)
)
),
titlePanel("Multiple languages example"),
sidebarLayout(
sidebarPanel(
tabsetPanel(
tabPanel("Python", verbatimTextOutput("pythonCode")),
tabPanel("Java", verbatimTextOutput("javaCode"))
)
),
mainPanel()
)
)
server <- function(input, output) {
output$pythonCode <- renderText({readLines('helloworld.py')})
output$javaCode <- renderText({readLines('helloworld.java')})
}
shinyApp(ui = ui, server = server)
It shows:
Is there anyway to set the style to the content of the verbatimTextoutput in base of the language programming? I would like to add line numbers also.

Using
shinyAcepackage for the editor andrclipboardpackage for the copy-to-clipboard button it is working: