Skip to content

Commit 636fbfd

Browse files
committed
hello, world!
0 parents  commit 636fbfd

File tree

31 files changed

+3252
-0
lines changed

31 files changed

+3252
-0
lines changed

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
^xaringanExtra\.Rproj$
2+
^\.Rproj\.user$
3+
^docs$

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# ---- Default .gitignore From grkmisc ----
2+
.Rproj.user
3+
.Rhistory
4+
.RData
5+
.DS_Store
6+
7+
# Directories that start with _
8+
_*/
9+
10+
## https://github.com/github/gitignore/blob/master/R.gitignore
11+
# History files
12+
.Rhistory
13+
.Rapp.history
14+
15+
# Session Data files
16+
.RData
17+
18+
# Example code in package build process
19+
*-Ex.R
20+
21+
# Output files from R CMD build
22+
/*.tar.gz
23+
24+
# Output files from R CMD check
25+
/*.Rcheck/
26+
27+
# RStudio files
28+
.Rproj.user/
29+
30+
# produced vignettes
31+
vignettes/*.html
32+
vignettes/*.pdf
33+
34+
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
35+
.httr-oauth
36+
37+
# knitr and R markdown default cache directories
38+
/*_cache/
39+
/cache/
40+
41+
# Temporary files created by R markdown
42+
*.utf8.md
43+
*.knit.md
44+
45+
# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
46+
rsconnect/
47+
48+
## https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
49+
# General
50+
.DS_Store
51+
.AppleDouble
52+
.LSOverride
53+
54+
# Icon must end with two \r
55+
Icon
56+
57+
58+
# Thumbnails
59+
._*
60+
61+
# Files that might appear in the root of a volume
62+
.DocumentRevisions-V100
63+
.fseventsd
64+
.Spotlight-V100
65+
.TemporaryItems
66+
.Trashes
67+
.VolumeIcon.icns
68+
.com.apple.timemachine.donotpresent
69+
70+
# Directories potentially created on remote AFP share
71+
.AppleDB
72+
.AppleDesktop
73+
Network Trash Folder
74+
Temporary Items
75+
.apdisk

DESCRIPTION

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Package: xaringanExtra
2+
Title: Extras And Addons for Xaringan Slides
3+
Version: 0.0.1
4+
Authors@R:
5+
c(person(given = "Garrick",
6+
family = "Aden-Buie",
7+
role = c("aut", "cre"),
8+
email = "garrick@aden-buie.com",
9+
comment = c(ORCID = "0000-0002-7111-0077")),
10+
person(given = "Yotam",
11+
family = "Mann",
12+
role = "ctb",
13+
comment = "tone.js"))
14+
Description: Extra addons for xaringan slides.
15+
License: MIT + file LICENSE
16+
Imports:
17+
htmltools,
18+
utils
19+
Suggests:
20+
xaringan
21+
Encoding: UTF-8
22+
LazyData: true
23+
Roxygen: list(markdown = TRUE)
24+
RoxygenNote: 6.1.1

NAMESPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated by roxygen2: do not edit by hand
2+
3+
export(xaringan_slide_tone)
4+
export(xaringan_slide_tone_dependency)
5+
export(xaringan_tile_view)
6+
export(xaringan_tile_view_dependency)

R/slide-tone.R

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#' Slide Tone
2+
#'
3+
#' Slide tone plays a subtle sound when you change slides.The tones increase in
4+
#' pitch for each slide from a low C to a high C note. The tone pitch stays the
5+
#' same for incremental slides.
6+
#'
7+
#' @return An [htmltools::tagList] with the slide tone dependencies, or an
8+
#' [htmltools::htmlDependency].
9+
#' @section Usage: To add slide tone to your xaringan presentation, add the
10+
#' following code chunk to your slides' R Markdown file.
11+
#'
12+
#' ````markdown
13+
#' ```{r xaringan-slide-tone, echo=FALSE}
14+
#' xaringanExtra::xaringan_slide_tone()
15+
#' ```
16+
#' ````
17+
#'
18+
#' @references [tone.js](https://tonejs.github.io/)
19+
#' @name slide_tone
20+
NULL
21+
22+
#' @describeIn slide_tone Adds slide tone to your xaringan slides.
23+
#' @export
24+
xaringan_slide_tone <- function() {
25+
htmltools::tagList(
26+
xaringan_slide_tone_dependency()
27+
)
28+
}
29+
30+
#' @describeIn slide_tone Returns an [htmltools::htmlDependency] with the tile
31+
#' view dependencies. Most users will want to use `xaringan_slide_tone()`.
32+
#' @export
33+
xaringan_slide_tone_dependency <- function() {
34+
htmltools::htmlDependency(
35+
name = "slide-tone",
36+
version = utils::packageVersion("xaringanExtra"),
37+
package = "xaringanExtra",
38+
src = "slide-tone",
39+
script = c("tone.js", "slide-tone.js")
40+
)
41+
}

R/tile-view.R

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#' Tile View
2+
#'
3+
#' Tile view gives you a way to quickly jump between slides. Just press `T` at
4+
#' any point in your slideshow and the tile view appears. Click on a slide to
5+
#' jump to the slide, or press `T` to exit tile view.
6+
#'
7+
#' @return An [htmltools::tagList] with the tile view dependencies, or an
8+
#' [htmltools::htmlDependency].
9+
#' @section Usage: To add tile view to your xaringan presentation, add the
10+
#' following code chunk to your slides' R Markdown file.
11+
#'
12+
#' ````markdown
13+
#' ```{r xaringan-tile-view, echo=FALSE}
14+
#' xaringanExtra::xaringan_tile_view()
15+
#' ```
16+
#' ````
17+
#'
18+
#' @name tile_view
19+
NULL
20+
21+
#' @describeIn tile_view Adds tile view to your xaringan slides.
22+
#' @export
23+
xaringan_tile_view <- function() {
24+
htmltools::tagList(
25+
xaringan_tile_view_dependency()
26+
)
27+
}
28+
29+
#' @describeIn tile_view Returns an [htmltools::htmlDependency] with the tile
30+
#' view dependencies. Most users will want to use `xaringan_tile_view()`.
31+
#' @export
32+
xaringan_tile_view_dependency <- function() {
33+
htmltools::htmlDependency(
34+
name = "tile-view",
35+
version = utils::packageVersion("xaringanExtra"),
36+
package = "xaringanExtra",
37+
src = "tile-view",
38+
script = "tile-view.js",
39+
stylesheet = "tile-view.css"
40+
)
41+
}
42+

R/utils.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
# use y if x is.null
3+
`%||%` <- function(x, y) if (is.null(x)) y else x
4+
5+
xe_file <- function(...) {
6+
system.file(..., package = "xaringanExtra", mustWork = TRUE)
7+
}

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
# xaringanExtra
3+
4+
<!-- badges: start -->
5+
<!-- badges: end -->
6+
7+
<!-- Links -->
8+
[xaringan]: https://slides.yihuie.name/xaringan
9+
10+
`xaringanExtra` is a playground of enhancements and addins for [xaringan] slides.
11+
12+
## Installation
13+
14+
You can install the current version of xaringanExtra from GitHub.
15+
16+
``` r
17+
# install.packages("devtools")
18+
devtools::install_github("gadenbuie/xaringanExtra")
19+
```
20+
21+
## &#x1F5FA; Tile View
22+
23+
#### &#x1F4FA; [Tile View Demo](https://gadenbuie.github.io/xaringanExtra/tile-view)
24+
25+
Tile view gives you a way to quickly jump between slides.
26+
Just press <kbd>T</kbd> at any point in your slideshow and the tile view appears.
27+
Click on a slide to jump to the slide, or press <kbd>T</kbd> to exit tile view.
28+
29+
![](man/figures/tile-view.png)
30+
31+
To add tile view to your xaringan presentation,
32+
add the following code chunk to your slides' R Markdown file.
33+
34+
````markdown
35+
```{r xaringan-tile-view, echo=FALSE}
36+
xaringanExtra::xaringan_tile_view()
37+
```
38+
````
39+
40+
Tile view is heavily inspired by
41+
(and is essentially a port to Vanilla JavaScript of)
42+
[a jQuery remarkjs hook](https://github.com/StephenHesperus/remark-hook/)
43+
by the same name by [Stephen Hesperus](https://github.com/StephenHesperus).
44+
45+
## &#x1F50A; Slide Tone
46+
47+
#### &#x1F4FA; [Slide Tone Demo](https://gadenbuie.github.io/xaringanExtra/slide-tone)
48+
49+
Slide tone plays a subtle sound when you change slides.
50+
It was
51+
[requested by a blind R user](https://github.com/yihui/xaringan/issues/214)
52+
and enables users to hear an auditory signal of their progress through the slides.
53+
54+
The tones increase in pitch for each slide from a low C to a high C note.
55+
The tone pitch stays the same for incremental slides.
56+
57+
Visit the
58+
[slide tone demo slides](https://gadenbuie.github.io/xaringanExtra/slide-tone)
59+
to experience it yourself.
60+
Or include slide tone in your next xaringan presentation
61+
by adding the following code chunk to your slides' R Markdown.
62+
63+
````markdown
64+
```{r xaringan-slide-tone, echo=FALSE}
65+
xaringanExtra::xaringan_slide_tone()
66+
```
67+
````

docs/slide-tone/index.Rmd

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: "xaringan<br/>slide-change sounds<br/>using tone.js"
3+
subtitle: "&#x1F50A;"
4+
author: "<a href='https://www.garrickadenbuie.com/'>Garrick Aden-Buie<a>"
5+
date: 'xaringanExtra'
6+
output:
7+
xaringan::moon_reader:
8+
css: [robot-fonts, robot]
9+
lib_dir: libs
10+
---
11+
12+
```{r slide-tone, echo=FALSE}
13+
options(htmltools.dir.version = FALSE)
14+
xaringanExtra::xaringan_slide_tone()
15+
```
16+
17+
## tone.js demo
18+
19+
<iframe height="450" style="width: 100%;" scrolling="no" title="tone-js-single-note-demo" src="https://codepen.io/grrrck/embed/abogWXm?height=265&theme-id=light&default-tab=html,result" frameborder="no" allowtransparency="true" allowfullscreen="true">
20+
See the Pen <a href='https://codepen.io/grrrck/pen/abogWXm'>tone-js-single-note-demo</a> by garrick
21+
(<a href='https://codepen.io/grrrck'>@grrrck</a>) on <a href='https://codepen.io'>CodePen</a>.
22+
</iframe>
23+
24+
---
25+
26+
class: center middle
27+
28+
## But wait...
29+
30+
--
31+
32+
This
33+
--
34+
slide
35+
--
36+
builds
37+
--
38+
suspense...
39+
40+
---
41+
42+
class: center middle
43+
layout: true
44+
45+
```{r results='asis', echo = FALSE}
46+
# Create 26 place-holder slides with giant letters
47+
48+
glue::glue("
49+
50+
---
51+
52+
# {LETTERS}
53+
54+
"
55+
)
56+
```
57+
58+
---
59+
layout: false
60+
class: center middle
61+
62+
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="25%" />
63+
64+
### [gadenbuie/xaringanExtra](https://github.com/gadenbuie/xaringanExtra)
65+
66+
67+
```{css echo=FALSE}
68+
/* Fancy Giant Letters */
69+
.remark-slide-content h1 {
70+
margin: 0;
71+
background: -webkit-linear-gradient(#0cbaba, #01baef);
72+
-webkit-background-clip: text;
73+
-webkit-text-fill-color: transparent;
74+
}
75+
.remark-slide-content:not(.title-slide) h1 {
76+
font-size: 30em;
77+
line-height: 1;
78+
text-shadow: 1px 4px 6px rgba(255,255,255,0.3);
79+
}
80+
a {
81+
color: #01baef;
82+
}
83+
a:hover {
84+
color: #0cbaba;
85+
}
86+
.remark-slide .title-slide h3 {
87+
color: #8d9597;
88+
}
89+
```

0 commit comments

Comments
 (0)