'R Shiny daterange input on R Markdown Title

I am using the robobook rmdformat R Markdown template. My markdown doc has some shiny inputs. I would like to have a dateRangeInput variable next to the title on the TOC legend off to the side. That way the user can scroll down and change the date from any part of the document. This obviously did not work, but I tried this below. Any help would be greatly appreciated.

  title: 'shiny::dateRangeInput("riskdate", "Select Risk Date Range",start = 
          lubridate::today()-1825,format ="yyyy-mm-dd"))'
  runtime: shiny
  output: rmdformats::robobook


Solution 1:[1]

With just a little bit of R code, we have an Rmarkdown document with rmdformats::robobook output document style. and runtime: shiny in the YAML as well. Shiny allows for extreme customization if you know CSS, HTML, JS. Used This link for Shiny date example

enter image description here

---
title: "Rmarkdown shiny by Date"
author: "StackOverflow"
date: "`r Sys.Date()`"
output: rmdformats::robobook
runtime: shiny
---


```{r echo = FALSE, message=FALSE, warning=FALSE}
shinyApp(

  ui = fluidPage(
    dateInput("date1", "Date:", value = "2022-02-16")
  ),

  server = function(input, output) {},

  options = list(width = 500)
)

```

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel Jachetta