Get renderUI html from shiny app in to params for R markdown output

I am looking to generate a report from a shiny app. I have some text that I want to pass to the params argument to go in to the report.

For example in the code below, I want the output of output$text passed in to a params argument. Any idea on how to do this (with formatting)? I have tried a few things, but can't get anything to work.

library(shiny)

ui <-  pageWithSidebar(
    headerPanel("Example"),
    sidebarPanel(
        sliderInput("number", 
                    label = "Select a number",
                    min = 1,
                    max = 4,
                    step = 1,
                    value = 2)),
    mainPanel(
        htmlOutput("text")
    ))
server <-  function(input, output) {
        output$text <- renderUI({
            HTML(paste("Number","<b>", input$number,"</b>", "selected" ))
        })
    }

shinyApp(ui = ui, server = server)