是否可以允许用户将自定义的html/css作为输入按钮更改与R Shiny应用程序中类似于常见的文本编辑器(例如Word/Excel)的文本?
因此,我有一个简单的闪亮应用程序,它将文本作为输入并输出。
但是我的目标是使我的用户更容易以易于使用的方式自定义该文本的字体和格式化。
这是应用程序的屏幕截图(下图)。我可以输入HTML代码来更改格式,但我的用户不知道HTML或CSS。
我的用户有没有一种简单的方法,可以使用一些可以通过输入传递的基本格式的UI?有点像这样吗?
这是我的应用程序代码:
library(shiny)
ui <- fluidPage(
sidebarLayout(
textAreaInput("text", label = HTML(paste0("Enter Text Here")), value = HTML(paste0("HTML ELEMENTS CAN BE USED"))),
mainPanel(
uiOutput("value"))
)
)
server <- function(input, output) {
output$value <- reactive({
shiny::HTML(paste0(input$text))
})
}
shinyApp(ui, server)
So I have a simple shiny app that takes text as an input and outputs it.
But my goal is to make it easier for my users to be able to customize the font and formatting of this text in an easy to use way.
Here is a screenshot of the app (below). I can enter HTML code to change the formatting but my users do not know HTML or CSS.
Is there an easy way for my users to be able to have a little UI with basic formatting that can be passed through the input? Kind of like this?
Here is my app code:
library(shiny)
ui <- fluidPage(
sidebarLayout(
textAreaInput("text", label = HTML(paste0("Enter Text Here")), value = HTML(paste0("HTML ELEMENTS CAN BE USED"))),
mainPanel(
uiOutput("value"))
)
)
server <- function(input, output) {
output$value <- reactive({
shiny::HTML(paste0(input$text))
})
}
shinyApp(ui, server)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用JavaScript库 suneditor
You can use the JavaScript library SunEditor