Skip to content

Instantly share code, notes, and snippets.

@isteves
Last active July 26, 2018 20:31
Show Gist options
  • Save isteves/48dd05282377d1ac3aab4f1064ee97eb to your computer and use it in GitHub Desktop.
Save isteves/48dd05282377d1ac3aab4f1064ee97eb to your computer and use it in GitHub Desktop.
Rendering markdown text
---
output:
html_document:
df_print: paged
runtime: shiny
---
```{r include = FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r}
library(shiny)
yml_info <- list(
tip1 = list(tip = 'This is a [link](https://community.rstudio.com/).'),
tip2 = list(tip = 'Here is an HTML <a href = "https://community.rstudio.com/">link</a>!'))
selectInput("whichtip", label = "Select puzzle:",
choices = c("tip1", "tip2"))
actionButton("tip", "Tip")
show_tip <- eventReactive(input$tip, {
yml_info[[input$whichtip]]$tip
})
```
The text here does not render (click tip to see):
```{r results = "asis"}
renderUI(show_tip())
```
The text here does:
```{r results = "asis"}
yml_info[["tip1"]]$tip
yml_info[["tip2"]]$tip
```
@isteves
Copy link
Author

isteves commented Jul 26, 2018

Screenshot:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment