Skip to content

Commit

Permalink
Merge pull request #1 from posit-conf-2024/new-site
Browse files Browse the repository at this point in the history
2024 site
  • Loading branch information
brendanhcullen authored Aug 5, 2024
2 parents 2e505c8 + 8ecc5c4 commit d9958bc
Show file tree
Hide file tree
Showing 152 changed files with 71,304 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$
13 changes: 13 additions & 0 deletions .build-site.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env Rscript

message("---- Building workshop website and slides ----")
message("Entering 'site/'")
setwd("site")
source("00-make-slides.R")
message("\nRendering quarto website...")
quarto::quarto_render()

message("Rendering quarto website...done!")
if (!nzchar(Sys.getenv("CI"))) {
message('Use `quarto::quarto_preview("site")` to preview the site')
}
55 changes: 55 additions & 0 deletions .github/workflows/render-quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: render-quarto

jobs:
render-quarto:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install R packages for site from DESCRIPTION
uses: r-lib/actions/setup-r-dependencies@v2

- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Render slides and quarto website
run: Rscript ./.build-site.R

- name: Deploy to Netlify
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: './site/_site'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
enable-pull-request-comment: true
enable-commit-comment: false
enable-commit-status: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
37 changes: 37 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Package: intro.to.tidyverse
Title: Dependencies for the Website for "Intro to the Tidyverse"
Version: 0.0.1
Authors@R: c(
person("Brendan", "Cullen", , "[email protected]", role = "aut"),
person("Kristin", "Bott", , "[email protected]", role = "aut"),
)
Description: Dependencies for the "Intro to the Data Science with R" workshop at
posit::conf(2024).
License: MIT + file LICENSE
Depends:
tidyverse
Imports:
flair (>= 0.0.2),
janitor,
knitr,
rmarkdown,
babynames
Suggests:
emo (>= 0.0.0.9000),
countdown (>= 0.3.5),
fontawesome,
here,
quarto,
usethis,
xaringan,
xaringanExtra,
reactable (>= 0.3.0),
ymlthis
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.0
Remotes:
hadley/emo,
r-for-educators/flair,
glin/reactable

1 change: 1 addition & 0 deletions site/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.qmd linguist-language=RMarkdown
3 changes: 3 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
_site/
_slides/
45 changes: 45 additions & 0 deletions site/00-make-slides.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
if (!file.exists("_quarto.yml")) {
stop("Please run this script from the quarto site base directory")
}

copy_slides_to_site <- function(from = "../slides", to = "_slides") {
message("Moving ", from, " into ", to)
if (fs::dir_exists(to)) fs::dir_delete(to)
fs::dir_copy(from, to)
}

render_all_slides <- function(dir = "_slides") {
message("\nRendering slides...")
message("Entering '_slides/' to render slides")
owd <- setwd(dir)
on.exit({
message("Returning to '", basename(owd), "/'")
message("Rendering slides...done!")
setwd(owd)
})

# Add Rmd files that should not be auto-rendered to this variable
# ex. c("not-a-slide-deck.Rmd")
EXCLUDE_RMDS <- c()

# Clean up the libs/ directory so we get a clean render
unlink("libs", recursive = TRUE)

# Find Rmds that need to be rendered
rmds <- dir(pattern = '[.][Rr]md')
rmds <- setdiff(rmds, EXCLUDE_RMDS)

# Render each slide deck
for (rmd in rmds) {
message("Rendering ", rmd)
callr::r_safe(
function(rmd) rmarkdown::render(rmd, quiet = TRUE),
args = list(rmd = rmd)
)
}

invisible(rmds)
}

copy_slides_to_site()
render_all_slides()
26 changes: 26 additions & 0 deletions site/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
project:
type: website
execute-dir: file
output-dir: _site
resources:
- "_slides/"

website:
title: "Introduction to Data Science with R"
favicon: "images/favicon.png"
repo-url: https://github.com/posit-conf-2023/r-intro
repo-actions: [source, issue]
page-navigation: true

navbar:
logo: "images/posit-logo-fullcolor-TM.png"
background: light

format:
html:
theme:
- cosmo
- styles.scss

editor: visual

Binary file added site/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/images/posit-logo-fullcolor-TM.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions site/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: "Introduction to Data Science with R"
subtitle: "posit::conf(2024)"
format:
html:
toc: true
---

## Welcome

This is not a standard workshop, but a six-week, online Posit Academy apprenticeship followed by a one-day, in-person learning experience at posit::conf(2024).


Here, you will learn the foundations of R for data science together with a close group of fellow learners, under the guidance of a Posit Academy mentor. Topics will include the basics of R, importing data, visualizing and wrangling data with the tidyverse, and reporting reproducibly with Quarto.

**Online Experience (July 1st - August 9th)**

You will be expected to complete a weekly curriculum of interactive tutorials and an applied data science project. You will attend two weekly meetings with your mentor and fellow learners via Zoom to work together, ask questions, and share your work with your group. Visit [posit.co/academy](http://posit.co/academy) to learn more about this uniquely effective learning format.


**In-person experience (August 12th)**

You will join your fellow learners at posit::conf(2024) to practice, apply and extend what you have learned through a series of group coding challenges, led by Posit Academy staff.


**This course is for you if you:**

* are new to R or the tidyverse,
* have dabbled in R, but now want a rigorous foundation in up-to-date data science best practices, or
* are a SAS or Excel user looking to switch your workflows to R.

## Schedule

| Time | Activity |
| :------------ | :-------------------------------------- |
| 09:00 - 10:30 | Session 1 - Welcome, Review & Data Types |
| 10:30 - 11:00 | *Coffee break* |
| 11:00 - 12:30 | Session 2 - Exploratory Data Analysis |
| 12:30 - 13:30 | *Lunch break* |
| 13:30 - 15:00 | Session 3 - Explore new data |
| 15:00 - 15:30 | *Coffee break* |
| 15:30 - 17:00 | Session 4 - Share and Wrap-up |
118 changes: 118 additions & 0 deletions site/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700;900&display=swap');


/*-- scss:defaults --*/

//## Brand colors for use across Bootstrap.

$primary: #2d70a5;

$brand-primary: #404040 !default;
$brand-success: #b8d3cc !default;
$brand-info: #5bc0de !default;
$brand-warning: #f0ad4e !default;
$brand-danger: #ff9982 !default;


//== nav

$navbar-bg: #faf7f5;
$navbar-fg: #404040;


// Body

$body-bg: #F5EFEB !default;
$body-color: $brand-primary;

$headings-color: #000000 !default;
$headings-font-weight: 600 !default;
$headings-small-color: #7b736c !default;

$table-border-color: #ffffff90 !default;

$code-bg: #ffffff90;
$code-color: #e47259;

// Buttons

$btn-default-color: #FFFFFF !default;
$btn-default-bg: #000000 !default;
$btn-default-border: #000000 !default;

// Global textual link color.

$link-color: #ba4900;

// Link hover color set via `darken()` function.

$link-hover-color: darken($link-color, 15%) !default;


/*-- scss:rules --*/

/* Code */

div.sourceCode {
background-color: white;
border: none;
}

/* Nav */

.navbar-brand>img {
max-height: 45px;
}

.navbar-brand:hover {
color: black !important;
font-weight: 600;
font-size: 1.21rem;
}


a.nav-link {
text-transform: uppercase;
font-size: 0.8em;
letter-spacing: 0.7pt;
font-weight: 600;
}

a.nav-link:hover {
font-weight: 700;
color: #7b736c !important;
}

a.nav-link.active {
font-weight: 900;
color: #7b736c !important;
}

/* table */

th {
color: #7b736c;
text-transform: uppercase;
font-weight: 500;
letter-spacing: 0.5pt;
font-size: 0.9em;
background-color: #ede7e3 !important;
border: none;
}

.table > thead {
border-bottom: none !important;
}

tbody {
background: #ffffff5c;
font-size: 0.9em;
letter-spacing: .1pt;
}


/* Body Links */

#quarto-content a {
font-weight: bold;
}
2 changes: 2 additions & 0 deletions slides/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
template.html
/*_files
5 changes: 5 additions & 0 deletions slides/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
For content authors:

All slides (including PDF and static slides) are stored here in the `slides/` directory. If you are working with R Markdown slides, you can build your slides with the usual Knit button or Cmd + Shift + K.

R Markdown slides should all share the same folders: `libs/`, `assets/`, `images/`, `data/` and `data-raw/`. Use slide-specific sub-directories in these top-level folders, e.g. `session01-review.Rmd` might use `images/session01-review/` or `data/session01-review/`.
Loading

0 comments on commit d9958bc

Please sign in to comment.