Many of these articles do assume familiarity with the mechanics of how shiny works, that is, basics of R, R-function arguments, reactivity, and so on. So I can see how this would be confusing when you're just getting started with these concepts.
If that is the case, the Shiny team created a three-hour intro course on Shiny here: https://shiny.rstudio.com/tutorial/, which is a great place to start. I feel this (with an intro to R, of course), will help make these docs much more useful.
Also, note that all this is documentation for a free and open source tool, so the shiny community is quite welcome to your ideas to improve this documentation.
To answer your question, what should this look like? the article gives an example of what this should look like in the code block reproduced below;
# Downloadable csv of selected dataset ----
output$downloadData <- downloadHandler(
filename = function() {
paste(input$dataset, ".csv", sep = "")
},
content = function(file) {
write.csv(datasetInput(), file, row.names = FALSE)
}
)
Note that rpaste(input$dataset, ".csv", sep = "") was placed into a function function(){...}