我希望在闪亮的应用程序中具有在用户在文本区域中输入输入后下载 word doc 的功能。用户将以 html 形式提供输入。下载按钮应生成 docx 文件。
library(shiny)
ui <- fluidPage(
fluidRow(
column(6, offset = 3,
hr(),
h2('Editor:'),
textInput('editor1', 'MY TEXT',
HTML('<b>Sam</b> <i>Dave</i>'),
),
hr(),
h2('Editor Content:'),
htmlOutput('editor1_content')
)
)
)
server <- function(input, output, session) {
output$editor1_content <- renderUI({HTML(enc2utf8(input$editor1))})
}
shinyApp(ui = ui, server = server)