Instructions and other materials related to the afternoon labs in the Biostatistics-courses
This repository is organized as monorepo to support multiple courses:
.
├── courses/
│ ├── course-1/ # First biostatistics course
│ │ ├── chapters/ # Course content chapters
│ │ ├── labs/ # Lab exercises
│ │ ├── _quarto.yml # Course-specific config
│ │ └── index.qmd # Course landing page
│ ├── course-2/ # Second biostatistics course
│ └── course-3/ # Third biostatistics course
├── index.qmd # Landing page source
└── _quarto.yml # Root configuration
From the repository root:
# Render landing page
quarto render index.qmd
# Render Course 1
quarto render courses/course-1
# Render Course 2
quarto render courses/course-2
# Render Course 3
quarto render courses/course-3
# (and so on for additional courses)From the repository root:
quarto render courses/course-1- Create a feature branch (e.g.
add-course-3). - Create directory
courses/course-3/with needed subfolders (chapters/,labs/). - Copy
_quarto.ymlfrom an existing course; update title/sidebar (keepfreeze: auto). - Add
index.qmdplus at least one chapter and one lab file (placeholders fine). - Render locally:
quarto render courses/course-3(createscourses/course-3/docs/and_freeze/). - Verify
_freeze/exists; commit new course files including_freeze/. - Update root
index.qmdto link to the new course. - Push branch and open a PR. The PR build will render the new course automatically (workflow loops over
courses/course-*). - Merge PR into
main; deployment publishes/course-3/. - To refresh computations later:
quarto render courses/course-3 --execute-refreshand commit updated_freeze/.
This repository deploys to its own GitHub Pages site at:
https://biostatistics-psychiatry.github.io/lab-materials/
- Pull Requests (PRs): Build runs rendering all courses for status checks. No deployment occurs.
- Merging PRs into
main: Build renders once, assembles a unified_site/directory, uploads a Pages artifact, then thedeploy-pagesaction publishes it. - Assembly:
_site/is created fresh each run (first step removes any previous_site). Contents copied:- Root rendered
docs/(landing page) - Each course's rendered
docs/into_site/course-1/,_site/course-2/, etc.
- Root rendered
_site/is never committed, it only exists inside the workflow runner.
This project uses freeze: auto to cache R computations. This means:
- First render: R code executes and results are cached in
_freeze/ - Subsequent renders: Cached results are used (no R execution needed)
- GitHub Actions: Only renders HTML from frozen content (no R required)
- Render before pushing: If you add a new chunk or modify code, run a normal render first so the cache populates, then commit any changes under
courses/course-*/_freeze/before pushing.
- Render before pushing: If you add a new chunk or modify code, run a normal render first so the cache populates, then commit any changes under
To mimic the CI page assembly, use the helper script:
bash scripts/preview-full-site.shThen visit http://localhost:8000 to inspect the complete project. The script renders all courses, assembles _site/, and serves it with Python.