Last active
July 26, 2018 20:31
-
-
Save isteves/48dd05282377d1ac3aab4f1064ee97eb to your computer and use it in GitHub Desktop.
Rendering markdown text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshot: