diff --git a/R/_metadata.yml b/R/_metadata.yml new file mode 100644 index 0000000..2b6e46e --- /dev/null +++ b/R/_metadata.yml @@ -0,0 +1 @@ +page-navigation: true \ No newline at end of file diff --git a/R/_sidebar.yml b/R/_sidebar.yml new file mode 100644 index 0000000..7d7f022 --- /dev/null +++ b/R/_sidebar.yml @@ -0,0 +1,4 @@ +- index.qmd +- r-basics.qmd +- rstudio.qmd +- project-management.qmd \ No newline at end of file diff --git a/R/img/2d_density.png b/R/img/2d_density.png new file mode 100644 index 0000000..4b7b8fb Binary files /dev/null and b/R/img/2d_density.png differ diff --git a/R/img/r-logo.png b/R/img/r-logo.png new file mode 100644 index 0000000..c61051f Binary files /dev/null and b/R/img/r-logo.png differ diff --git a/R/img/rstudio.png b/R/img/rstudio.png new file mode 100644 index 0000000..385c98b Binary files /dev/null and b/R/img/rstudio.png differ diff --git a/R/index.qmd b/R/index.qmd new file mode 100644 index 0000000..cceab1a --- /dev/null +++ b/R/index.qmd @@ -0,0 +1,138 @@ +--- +title: "Getting started with R and RStudio" +description: "This is a description" +author: + - Lewis A. Jones + - Erin M. Dillon +date: "`r Sys.Date()`" +categories: [r, tidyverse, dataviz] +difficulty: Beginner +image: img/2d_density.png +format: + html: + toc: true + revealjs: + smaller: true + output-file: index-slides.html + css: style/template.css + slide-number: c/t + include-in-header: style/header.html + include-after-body: style/footer.html +execute: + output-location: fragment + echo: true + warning: false + message: false + freeze: auto +filters: + - at: pre-ast + path: web_and_slides_autogenerated.lua +editor: + markdown: + wrap: 72 +--- + + + + +## Introduction + +::: {.narration} +Prose goes in a `.narration` block: it reads as a paragraph on the website, and +becomes the speaker notes you talk from on the slides. Press `s` in the deck to +see the notes view. + +Consecutive paragraphs can share one block; they stay separate paragraphs on +the page and separate notes on the slide. +::: + +::: {.slides-only} +- a bullet summary for the slide +- which would be redundant on the page +::: + +::: {.html-only} +Content that only makes sense in writing (e.g., a long aside, a table of options, a +link dump) goes in an `.html-only` block and never reaches the deck. +::: + +## One plot per slide + +::: {.narration} +Each `##` heading starts a slide, and the filter closes the slide after every +figure, so two plots never share one slide. Prose after a figure introduces the next +figure rather than trailing behind the old one. +::: + +```{r} +plot(mtcars$wt, mtcars$mpg) +``` + +::: {.narration} +This narration belongs to the plot below, and lands on its slide as speaker notes. +::: + +```{r} +plot(mtcars$hp, mtcars$mpg) +``` + +## Deeper headings + +::: {.narration} +`###` and deeper headings are promoted to slide level, so each becomes its own +slide instead of piling onto the previous slide. On the website they stay a normal +sub-heading. +::: + +### A sub-heading + +::: {.narration} +This is its own slide. +::: + +## Building up a slide + +::: {.narration} +When a slide holds two or more code chunks, the filter expands it into an +auto-animate build-up: one step per chunk, earlier chunks staying on screen, and +the narration advancing with each step/click. +::: + +```{r} +x <- mtcars$wt +mean(x) +``` + +::: {.narration} +The second chunk arrives on the next step, with the first still visible. +::: + +```{r} +round(sd(x), 3) +``` + +## Callouts + +::: {.narration} +A callout gets a slide of its own. The content is un-boxed and the slide is titled by its own heading. +::: + +::: {.callout-note} +## A note + +This box is dropped on the slide, which lets a figure inside it stretch to fit. +::: + +::: {.callout-caution collapse="true"} +## An exercise solution + +A *collapsed* callout is the exception: it keeps its box. Since clicking on +slides can be awkward, the collapsed content is held back as a fragment and +revealed when you advance. On the website it stays a click-to-open box. +::: + +## More info + +- [Quarto revealjs](https://quarto.org/docs/presentations/revealjs/) +- [Callouts](https://quarto.org/docs/authoring/callouts.html) +- the repo README, for the other two ways to build a module diff --git a/R/project-management.qmd b/R/project-management.qmd new file mode 100644 index 0000000..9d821a1 --- /dev/null +++ b/R/project-management.qmd @@ -0,0 +1,138 @@ +--- +title: "Project Management with RStudio" +description: "This is a description" +author: + - An author + - Another author +date: "`r Sys.Date()`" +categories: [r] +difficulty: Beginner +image: img/2d_density.png +format: + html: + toc: true + revealjs: + smaller: true + output-file: project-management-slides.html + css: style/template.css + slide-number: c/t + include-in-header: style/header.html + include-after-body: style/footer.html +execute: + output-location: fragment + echo: true + warning: false + message: false + freeze: auto +filters: + - at: pre-ast + path: web_and_slides_autogenerated.lua +editor: + markdown: + wrap: 72 +--- + + + + +## Introduction + +::: {.narration} +Prose goes in a `.narration` block: it reads as a paragraph on the website, and +becomes the speaker notes you talk from on the slides. Press `s` in the deck to +see the notes view. + +Consecutive paragraphs can share one block; they stay separate paragraphs on +the page and separate notes on the slide. +::: + +::: {.slides-only} +- a bullet summary for the slide +- which would be redundant on the page +::: + +::: {.html-only} +Content that only makes sense in writing (e.g., a long aside, a table of options, a +link dump) goes in an `.html-only` block and never reaches the deck. +::: + +## One plot per slide + +::: {.narration} +Each `##` heading starts a slide, and the filter closes the slide after every +figure, so two plots never share one slide. Prose after a figure introduces the next +figure rather than trailing behind the old one. +::: + +```{r} +plot(mtcars$wt, mtcars$mpg) +``` + +::: {.narration} +This narration belongs to the plot below, and lands on its slide as speaker notes. +::: + +```{r} +plot(mtcars$hp, mtcars$mpg) +``` + +## Deeper headings + +::: {.narration} +`###` and deeper headings are promoted to slide level, so each becomes its own +slide instead of piling onto the previous slide. On the website they stay a normal +sub-heading. +::: + +### A sub-heading + +::: {.narration} +This is its own slide. +::: + +## Building up a slide + +::: {.narration} +When a slide holds two or more code chunks, the filter expands it into an +auto-animate build-up: one step per chunk, earlier chunks staying on screen, and +the narration advancing with each step/click. +::: + +```{r} +x <- mtcars$wt +mean(x) +``` + +::: {.narration} +The second chunk arrives on the next step, with the first still visible. +::: + +```{r} +round(sd(x), 3) +``` + +## Callouts + +::: {.narration} +A callout gets a slide of its own. The content is un-boxed and the slide is titled by its own heading. +::: + +::: {.callout-note} +## A note + +This box is dropped on the slide, which lets a figure inside it stretch to fit. +::: + +::: {.callout-caution collapse="true"} +## An exercise solution + +A *collapsed* callout is the exception: it keeps its box. Since clicking on +slides can be awkward, the collapsed content is held back as a fragment and +revealed when you advance. On the website it stays a click-to-open box. +::: + +## More info + +- [Quarto revealjs](https://quarto.org/docs/presentations/revealjs/) +- [Callouts](https://quarto.org/docs/authoring/callouts.html) +- the repo README, for the other two ways to build a module diff --git a/R/r-basics.qmd b/R/r-basics.qmd new file mode 100644 index 0000000..0da31cf --- /dev/null +++ b/R/r-basics.qmd @@ -0,0 +1,138 @@ +--- +title: "R Basics" +description: "This is a description" +author: + - Lewis A. Jones + - Erin M. Dillon +date: "`r Sys.Date()`" +categories: [r] +difficulty: Beginner +image: img/r-logo.png +format: + html: + toc: true + revealjs: + smaller: true + output-file: r-basics-slides.html + css: style/template.css + slide-number: c/t + include-in-header: style/header.html + include-after-body: style/footer.html +execute: + output-location: fragment + echo: true + warning: false + message: false + freeze: auto +filters: + - at: pre-ast + path: web_and_slides_autogenerated.lua +editor: + markdown: + wrap: 72 +--- + + + + +## Introduction + +::: {.narration} +Prose goes in a `.narration` block: it reads as a paragraph on the website, and +becomes the speaker notes you talk from on the slides. Press `s` in the deck to +see the notes view. + +Consecutive paragraphs can share one block; they stay separate paragraphs on +the page and separate notes on the slide. +::: + +::: {.slides-only} +- a bullet summary for the slide +- which would be redundant on the page +::: + +::: {.html-only} +Content that only makes sense in writing (e.g., a long aside, a table of options, a +link dump) goes in an `.html-only` block and never reaches the deck. +::: + +## One plot per slide + +::: {.narration} +Each `##` heading starts a slide, and the filter closes the slide after every +figure, so two plots never share one slide. Prose after a figure introduces the next +figure rather than trailing behind the old one. +::: + +```{r} +plot(mtcars$wt, mtcars$mpg) +``` + +::: {.narration} +This narration belongs to the plot below, and lands on its slide as speaker notes. +::: + +```{r} +plot(mtcars$hp, mtcars$mpg) +``` + +## Deeper headings + +::: {.narration} +`###` and deeper headings are promoted to slide level, so each becomes its own +slide instead of piling onto the previous slide. On the website they stay a normal +sub-heading. +::: + +### A sub-heading + +::: {.narration} +This is its own slide. +::: + +## Building up a slide + +::: {.narration} +When a slide holds two or more code chunks, the filter expands it into an +auto-animate build-up: one step per chunk, earlier chunks staying on screen, and +the narration advancing with each step/click. +::: + +```{r} +x <- mtcars$wt +mean(x) +``` + +::: {.narration} +The second chunk arrives on the next step, with the first still visible. +::: + +```{r} +round(sd(x), 3) +``` + +## Callouts + +::: {.narration} +A callout gets a slide of its own. The content is un-boxed and the slide is titled by its own heading. +::: + +::: {.callout-note} +## A note + +This box is dropped on the slide, which lets a figure inside it stretch to fit. +::: + +::: {.callout-caution collapse="true"} +## An exercise solution + +A *collapsed* callout is the exception: it keeps its box. Since clicking on +slides can be awkward, the collapsed content is held back as a fragment and +revealed when you advance. On the website it stays a click-to-open box. +::: + +## More info + +- [Quarto revealjs](https://quarto.org/docs/presentations/revealjs/) +- [Callouts](https://quarto.org/docs/authoring/callouts.html) +- the repo README, for the other two ways to build a module diff --git a/R/rstudio.qmd b/R/rstudio.qmd new file mode 100644 index 0000000..421a9e0 --- /dev/null +++ b/R/rstudio.qmd @@ -0,0 +1,138 @@ +--- +title: "Introduction to RStudio" +description: "This is a description" +author: + - Lewis A. Jones + - Erin M. Dillon +date: "`r Sys.Date()`" +categories: [r] +difficulty: Beginner +image: img/rstudio.png +format: + html: + toc: true + revealjs: + smaller: true + output-file: rstudio-slides.html + css: style/template.css + slide-number: c/t + include-in-header: style/header.html + include-after-body: style/footer.html +execute: + output-location: fragment + echo: true + warning: false + message: false + freeze: auto +filters: + - at: pre-ast + path: web_and_slides_autogenerated.lua +editor: + markdown: + wrap: 72 +--- + + + + +## Introduction + +::: {.narration} +Prose goes in a `.narration` block: it reads as a paragraph on the website, and +becomes the speaker notes you talk from on the slides. Press `s` in the deck to +see the notes view. + +Consecutive paragraphs can share one block; they stay separate paragraphs on +the page and separate notes on the slide. +::: + +::: {.slides-only} +- a bullet summary for the slide +- which would be redundant on the page +::: + +::: {.html-only} +Content that only makes sense in writing (e.g., a long aside, a table of options, a +link dump) goes in an `.html-only` block and never reaches the deck. +::: + +## One plot per slide + +::: {.narration} +Each `##` heading starts a slide, and the filter closes the slide after every +figure, so two plots never share one slide. Prose after a figure introduces the next +figure rather than trailing behind the old one. +::: + +```{r} +plot(mtcars$wt, mtcars$mpg) +``` + +::: {.narration} +This narration belongs to the plot below, and lands on its slide as speaker notes. +::: + +```{r} +plot(mtcars$hp, mtcars$mpg) +``` + +## Deeper headings + +::: {.narration} +`###` and deeper headings are promoted to slide level, so each becomes its own +slide instead of piling onto the previous slide. On the website they stay a normal +sub-heading. +::: + +### A sub-heading + +::: {.narration} +This is its own slide. +::: + +## Building up a slide + +::: {.narration} +When a slide holds two or more code chunks, the filter expands it into an +auto-animate build-up: one step per chunk, earlier chunks staying on screen, and +the narration advancing with each step/click. +::: + +```{r} +x <- mtcars$wt +mean(x) +``` + +::: {.narration} +The second chunk arrives on the next step, with the first still visible. +::: + +```{r} +round(sd(x), 3) +``` + +## Callouts + +::: {.narration} +A callout gets a slide of its own. The content is un-boxed and the slide is titled by its own heading. +::: + +::: {.callout-note} +## A note + +This box is dropped on the slide, which lets a figure inside it stretch to fit. +::: + +::: {.callout-caution collapse="true"} +## An exercise solution + +A *collapsed* callout is the exception: it keeps its box. Since clicking on +slides can be awkward, the collapsed content is held back as a fragment and +revealed when you advance. On the website it stays a click-to-open box. +::: + +## More info + +- [Quarto revealjs](https://quarto.org/docs/presentations/revealjs/) +- [Callouts](https://quarto.org/docs/authoring/callouts.html) +- the repo README, for the other two ways to build a module diff --git a/R/style/footer.html b/R/style/footer.html new file mode 100644 index 0000000..3a8b0e7 --- /dev/null +++ b/R/style/footer.html @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/R/style/header.html b/R/style/header.html new file mode 100644 index 0000000..b8fd162 --- /dev/null +++ b/R/style/header.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/R/style/logo_top_right.png b/R/style/logo_top_right.png new file mode 100644 index 0000000..72455f2 Binary files /dev/null and b/R/style/logo_top_right.png differ diff --git a/R/style/template.css b/R/style/template.css new file mode 100644 index 0000000..7a61ee0 --- /dev/null +++ b/R/style/template.css @@ -0,0 +1,125 @@ +/* Same background as on the website */ +.reveal .slide-background { + background: rgb(245.4, 250.35, 250.65); +} + +p, +h1, +h2, +h3, +h4, +h5, +h6, +ul, +ol, +li, +center, +.quarto-title-authors { + color: #575756 !important; +} + +/* Logo pinned in the top right corner of every slide */ +.reveal::after { + content: ""; + position: fixed; + right: 10%; + top: -5px; + width: 15%; + height: 15%; + background-image: url(logo_top_right.png); + background-size: contain; + background-position: right bottom; + background-repeat: no-repeat; + z-index: 10; +} + +/* Social links footer, on the title slide only */ +.title-footer { + display: none; + position: fixed; + bottom: 0; + left: 0; + height: 3%; + width: 100%; + padding: 0.6em 1em; + text-align: center; + font-family: var(--r-main-font); + font-size: 18px; + color: white; + background-color: #0d725a; + z-index: 10; +} + +.title-footer span { + margin: 0 1.5em; +} + +.title-footer a { + display: inline-flex; + align-items: center; + color: white; + text-decoration: none; +} + +.title-footer i { + font-size: 1.4em; +} + +body:has(#title-slide.present) .title-footer { + display: flex; + align-items: center; + justify-content: center; +} + +/* Larger logo on the title slide */ +.reveal:has(#title-slide.present)::after { + width: 30%; + height: 30%; + left: 33%; + top: -45px; +} + +/* Recolor the menu icon (it is an image, not a glyph) */ +body:has(#title-slide.present) .reveal .slide-menu-button .fa-bars::before { + filter: brightness(0) invert(1); +} + +h1 { + text-align: center; +} + +/* Slide numbers: plain text, not on the title slide */ +.reveal .slide-number a { + color: #575756; + text-decoration: none; + pointer-events: none; +} + +body:has(#title-slide.present) .reveal .slide-number { + display: none !important; +} + +/* Code almost at the same size as the surrounding text */ +.reveal code { + font-size: 0.9em; +} + +.reveal pre { + font-size: 0.7em; +} + +/* Slightly rounded code blocks */ +.reveal div.sourceCode { + border-radius: 8px; + overflow: hidden; + border: 1px solid #0d725a; +} + +.reveal pre { + border-radius: 8px; +} + +/* Wrap the slide title to avoid overlapping with the logo in the top right corner */ +section>h2 { + width: 85%; +} \ No newline at end of file diff --git a/R/web_and_slides_autogenerated.lua b/R/web_and_slides_autogenerated.lua new file mode 100644 index 0000000..dd7ad54 --- /dev/null +++ b/R/web_and_slides_autogenerated.lua @@ -0,0 +1,307 @@ +-- web_and_slides_autogenerated.lua -- AUTOGENERATED, DO NOT EDIT. +-- Copied from the repo root's web_and_slides.lua by sync_filter.r (see _quarto.yml). +-- Edit that file instead; this copy exists so the module is self-contained. +-- +-- web_and_slides.lua +-- Combined filter for dual html + revealjs Quarto modules: +-- * Div : `::: {.narration}` -> speaker notes on revealjs, plain prose elsewhere. +-- `::: {.slides-only}` -> revealjs slides only: dropped elsewhere +-- (equivalent to `::: {.content-visible when-format="revealjs"}`) +-- `::: {.html-only}` -> html only: dropped on revealjs slides +-- (equivalent to `::: {.content-hidden when-format="revealjs"}`) +-- * Pandoc : on revealjs, headings below the slide level are promoted so each +-- becomes its own slide, the slide closes after each plot (so no two +-- plots share a slide and a plot's following prose stays with the +-- next plot -- unless only prose remains before the next heading, in +-- which case it stays put rather than making a blank slide), and each +-- callout is unwrapped onto its own slide titled by its own heading +-- (no box, so any figure inside hoists and stretches; an untitled +-- callout keeps the section title; a callout the author collapsed +-- keeps its box, its body held back as a fragment, since revealjs +-- ignores Quarto's `collapse`). Split slides repeat the current +-- heading so they keep a title. Finally, any slide with 2+ cells is +-- expanded into an auto-animate build-up (one step per cell, cells +-- accumulating, notes advancing) so each step is a real slide whose +-- figure still hoists and auto-stretches; an interactive quarto-live +-- cell is skipped there, since duplicating it duplicates the editor. +-- Other formats untouched. +-- Register at the `pre-ast` stage so callouts are still plain divs here (Quarto +-- normalizes them into custom AST nodes after that point). + +function Div(el) + if el.classes:includes("slides-only") then + if not quarto.doc.is_format("revealjs") then + return {} -- slides only: nothing on the website + end + return el.content + end + if el.classes:includes("html-only") then + if quarto.doc.is_format("revealjs") then + return {} -- html only: nothing on the slides + end + return el.content + end + if not el.classes:includes("narration") then + return nil -- leave every other div alone + end + if quarto.doc.is_format("revealjs") then + el.classes = el.classes:filter(function(c) return c ~= "narration" end) + el.classes:insert("notes") -- Pandoc emits