-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresources.Rmd
executable file
·75 lines (62 loc) · 2.47 KB
/
resources.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
---
title: "Our Resource Page Title"
---
```{r, include=FALSE}
## This block just has comments to describe what's happening
# You only need one hashtag/pound symbol, but I like using two
# With Rmarkdown, you can mix R, Markdown, and HTML syntax
# which is why we're using an R block for commenting this!
## Anyway, because we're using the SearchBuilder option, it's nice
## to know what options there are in the table, so we're just including a
## bulleted list below this block
## You don't have to keep to 80 character columns, I just spend a lot of time
## with Python and Terminals, so I like to keep to that
```
- **Keywords**: red, orange, yellow, green, blue, indigo, purple, violet,
silver, gold, brown, black, OneExtremelyLongKeyword
- **Region**: one, two, three, four, five, six, seven, eight, nine, ten, eleven,
twelve
```{r, include=FALSE}
## This code block loads in the packages we need to modify the CSV (tidyverse)
## and render the data table (DT)
library(tidyverse)
library(DT)
```
```{r, echo=FALSE, message=FALSE}
## Load resource list
## Note: If you encounter issues with characters, try resaving the
## CSV as a UTF-8 CSV. Excel... does not like interpreting as UTF-8
## We specify the comment character inside the CSV so that we can remove
## rows that may temporarily be inactive
data <- read_csv("resources.csv", comment = "#")
## Make URLs a hyperlink
## The target _blank portion forces the link to be opened in a new tab
data$ShortLink <- paste0("<a href='https://",data$ShortLink,
"'target='_blank'>","https://",data$ShortLink,"</a>")
## Remove website column, since it's just something we needed internally
## To update the shortlinks (this way we know where they point without
## messing up our data analytics)
data <- select(data, -c(Website))
## Render the table with all the extensions and options we want
## Examples of these options in R syntax are available on the DT site
## https://rstudio.github.io/DT/
## For general JavaScript DataTables options see https://datatables.net/
datatable(data,
rownames=FALSE,
escape = FALSE,
extensions = c('Responsive', 'Buttons', 'SearchBuilder'),
options = list(
dom = 'QBfrtip',
buttons = list(
'copy', 'csv', 'excel',
list(extend = 'pdf',
orientation = 'landscape',
## A3 paper: 29.7 x 42.0cm or 11.69 x 16.53 inches
exportoptions=list(pageSize='A3')
),
'print')
)
)
```
## Example Heading
This is some example text.