-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.Rmd
89 lines (77 loc) · 2.84 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: " "
output: html_document
runtime: shiny_prerendered
---
```{r context="setup", include=FALSE}
#guide is here
# https://rmarkdown.rstudio.com/authoring_shiny_prerendered.html
# https://pkgs.rstudio.com/learnr/articles/publishing.html
#install libraries
library(tidyverse)
library(shiny)
library(learnr)
library(DT)
knitr::opts_chunk$set(echo = FALSE)
```
```{r data, include=FALSE}
object_table <- readRDS("object_table.Rds")
```
```{r}
#all images must be in images dir
HTML("<center><br><br><img src='www/tidybiology_hex.png', width ='338'></center>")
```
```{r, context="render"}
# Create output for our router in main UI of Shiny app.
fluidPage(
tagList(
tags$style(type = 'text/css',
"footer{position: absolute; bottom:5%; left: 10%; padding:5px;}"
),
tags$head(
tags$meta(charset="UTF-8"),
tags$meta(name="title", content="tidybiology.org"),
tags$meta(name="description", content="Learning datascience")
),
tags$div(
tags$br(),
HTML(paste("<center>Tidybiology is a resource developed by the <a href='http://www.hirscheylab.org' style='color:black;'>Hirschey Lab</a> for learning data science.</center>")),
tags$br(),
tags$br()),
HTML("<center>"),
shiny::actionButton(inputId='start',
label="Get Started",
icon = NULL, #icon("th"),
onclick ="window.open('http://module.tidybiology.org/1', '_blank')",
class = "btn-success"), #this makes the button green; use CSS to modify later
HTML("<br>"),
HTML("<br>"),
HTML("<a href='http://module.tidybiology.org/map'>Browse the tracks</a>"),
", ",
HTML("<a href='http://module.tidybiology.org/quiz'>test yourself</a>"), # placeholder
", or",
actionLink(inputId = "search_click", "search the learning materials"),
HTML("</center>"),
conditionalPanel(condition = paste0("input['search_click'] != 0"),
tags$br(),
h4("Learning Materials"),
DT::dataTableOutput(outputId = "object_table")),
HTML('<footer>
<a href="http://module.tidybiology.org/example" target="_blank"><img src="https://raw.githubusercontent.com/matthewhirschey/tidybiology.org/main/www/butterfly.png" height="3%" width="3%"></a>
</footer>')
)
)
```
```{r, context="server"}
observeEvent(input$search_click, {}) #event to store the 'click'
output$object_table <- DT::renderDataTable({
DT::datatable(object_table %>%
dplyr::select(Title = title,
Level = level,
Language = language,
Type = type,
'Included in' = included_in),
escape = FALSE,
options = list(pageLength = 10))
})
```