```{r renv.ignore = TRUE}
{{id}}_module_ui <- function(id) {
  ns <- shiny::NS(id)
  tagList(
    # UI
```
```{r renv.ignore = TRUE, purl = {{download}} }
    actionButton(ns("run"), "Run module {{id}}", icon = icon("arrow-turn-down")),
    downloadButton(ns("download"), "Download")
```
```{r renv.ignore = TRUE, purl = {{!download}} }
    actionButton(ns("run"), "Run module {{id}}", icon = icon("arrow-turn-down"))
```
```{r renv.ignore = TRUE}
  )
}

{{id}}_module_server <- function(id, common, parent_session) {
  moduleServer(id, function(input, output, session) {
```
```{r renv.ignore = TRUE, purl = {{download}} }
  shinyjs::hide("download")
```
```{r renv.ignore = TRUE}
  observeEvent(input$run, {
    # WARNING ####

    # FUNCTION CALL ####

    # LOAD INTO COMMON ####

    # METADATA ####
    # Populate using metadata()

    # TRIGGER
    trigger("{{id}}")
```
```{r renv.ignore = TRUE, purl = {{download}} }
    shinyjs::show("download")
```
```{r renv.ignore = TRUE}
  })
```{r renv.ignore = TRUE, purl = {{result}} }
  output$result <- renderText({
    watch("{{id}}")
    # Result
  })
```
```{r renv.ignore = TRUE, purl = {{download}} }
  output$download <- downloadHandler(
    filename = function() {
      "placeholder.ext"
    },
    content = function(file) {
      # Download content
    })
```
```{r renv.ignore = TRUE, purl = {{save}} }
  return(list(
    save = function() {
      # Save any values that should be saved when the current session is saved
      # Populate using save_and_load()
    },
    load = function(state) {
      # Load
      # Populate using save_and_load()
    }
  ))
```
```{r renv.ignore = TRUE}
})
}

```{r renv.ignore = TRUE, purl = {{result}} }
{{id}}_module_result <- function(id) {
  ns <- NS(id)

  # Result UI
  verbatimTextOutput(ns("result"))
}
```
```{r renv.ignore = TRUE, purl = {{map}} }
{{id}}_module_map <- function(map, common) {
  # Map logic
}
```
```{r renv.ignore = TRUE, purl = {{rmd}} }
{{id}}_module_rmd <- function(common) {
  # Variables used in the module's Rmd code
  # Populate using metadata()
}
```
