title: How to export HTML Output using downloadHandler in R shiny?
body: <p>I have an R shiny app using the compare_df function as part of the compareDF package and it produces an HTML output. I was wondering how to export this as an HTML file using downloadHandler? This is my attempt:</p>
  
  <p>Partial Code</p>
  
  <pre><code>
  ui &lt;- fluidPage(
  sliderPanel(
     downloadButton("Export_HTML", "Export as Data Listing")
    ),
    # Main panel for displaying outputs ----
    mainPanel(uiOutput('html'))
    )
  
  server &lt;- function(input,output){
  
  a&lt;-- c("1","2","3")
  
  diff&lt;-compare_df(filedata2, filedata1, group_col = a)
     output$html &lt;- renderUI({
  
        HTML(knit2html(text=diff[["html_output"]], fragment.only=TRUE))
  })
  
    output$Export_HTML &lt;- downloadHandler(
      filename = function() {
        paste("Comparison-", Sys.Date(), ".html", sep = "")
      },
      content = function(file) {
  
        saveWidget(as_widget(diff[["html_output"]]), file, selfcontained = TRUE)
      }
    )
  }
  
  </code></pre>