I am trying to embed markdown within a shinydashboard box, to be later deployed on a shiny server. Using the solution here, I have created the following:
ui.R
library(shinydashboard)
dashboardPage(
dashboardHeader(title = "xxx"),
dashboardSidebar(),
dashboardBody(
column(
box(
title = "BoxTest",
uiOutput('mymarkdown'),
width = NULL
),
width = 8)
)
)
server.R
library(shiny)
library(knitr)
shinyServer(function(input, output) {
output$mymarkdown <- renderUI(HTML(markdown::markdownToHTML(knit("mymarkdown.Rmd", quiet = TRUE))))
})
mymarkdown.Rmd
## R Markdown
Test Test Test
This creates the following:
If I switch to a non-markdown implementation, for example:
output$mymarkdown <- renderUI(h4("Test Test Test"))
I get:
the view I would expect.
Is there any way to avoid this compression of the page, or is there another way to deploy markdown text in a shinydashboard box?