Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: 🔧 add files to auto-build website #4

Merged
merged 8 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build-website.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is what auto-builds the website and puts it online. You don't need to touch it or change it at all.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build website to GitHub Pages

on:
push:
branches:
- main

# You need these permissions to publish to GitHub pages
permissions:
contents: write
pages: write

jobs:
build-deploy:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tinytex: false

- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Install R package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2

- name: Publish to GitHub Pages (and render)
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
# This secret is always available for github actions
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 23 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
# RStudio and R files
.Rbuildignore
.Rproj.user
.Rhistory
.RData
.Ruserdata
.Rdata

# Temporary files
*.tmp

# Authentication files
.httr-oauth

# MacOS
.DS_Store

# Quarto
/.quarto/

# Website generation
_site
_book
_freeze
*_files
*.html

20 changes: 20 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Package: ideg.mediation.course
Type: Website
Version: 0.1
Title: "Mediation course"
Depends:
R (>= 3.6.0),
tidyverse
Encoding: UTF-8
LazyData: true
Imports:
CMAverse,
DiagrammeR,
DiagrammeRsvg,
dplyr,
here,
knitr,
medflex,
mediation,
readr,
rmarkdown
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)

## Description

This short workshop on Directed Acyclic Graphs (DAGs) and mediation analysis
is offered as part of the [International Diabetes Epidemiology Group (IDEG)
Trainee Workshop](https://www.ideg-diabetes.org/idegtraineeworkshop) in
is offered as part of the [International Diabetes Epidemiology Group (IDEG)
Trainee Workshop](https://www.ideg-diabetes.org/idegtraineeworkshop) in
Bangkok, Thailand, on 3 April 2025.

This repository contains the lesson, lecture, and assignment material
for the course, including the website source files and other associated
course administration files.

To install the packages needed to build this website, run:

``` r
pak::pak()
```

## Contributing
Build the website either in RStudio with `Ctrl-Shift-B` or:

If you are interested in contributing to the course material, please
refer to the [contributing guidelines](CONTRIBUTING.md). Please note
that the project is released with a [Contributor Code of
Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree
to abide by its terms.
``` r
quarto::quarto_render()
```
34 changes: 34 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
project:
type: book
# pre-render: quarto render slides/*.qmd
# resources:
# - slides/*.html

book:
title: "Mediation course"
author:
- Jie Zhang
- Daniel Witte
date: last-modified
repo-url: https://github.com/steno-aarhus/IDEG-mediation-course
site-url: https://steno-aarhus.github.io/IDEG-mediation-course
chapters:
- index.qmd
- part: "Preamble"
- part: "Sessions"
chapters:
- sessions/welcome.qmd
- sessions/motivation.qmd
- sessions/traditional-mediation-analysis.qmd
appendices:
- appendix/welcome.qmd
Comment on lines +15 to +24
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is where you add the files you want put onto the website. Unfortunately, you can't put slide files here. But we deal with that when you get to it.

I didn't put anything into part: "Preamble" because your precourse.qmd file was in one of the _files/ folders, which I moved in #2, so that needs to be merged first before you can add it correctly here.

page-footer:
center:
- text: "License: CC BY 4.0"

format: html

editor:
markdown:
wrap: 72
canonical: true
File renamed without changes.
File renamed without changes.
27 changes: 19 additions & 8 deletions Appendix/1.Welcome.qmd → appendix/welcome.qmd
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
title: "Mediation Ananlysis"
format: html
editor: visual
---

## Welcome

Welcome to the short workshop on Directed Acyclic Graphs (DAGs) and mediation analysis!
Welcome to the short workshop on Directed Acyclic Graphs (DAGs) and
mediation analysis!

Instrctors: Daniel Witte, Jie Zhang

Time duration: 75 mins

# Course Outline

During this 75-minute course, you will learn about traditional mediation approaches before exploring the theory of causal mediation, accompanied by hands-on R coding practice. We hope this will be the beginning of your journey in mediation analysis and open the door to more interesting research studies!
During this 75-minute course, you will learn about traditional mediation
approaches before exploring the theory of causal mediation, accompanied
by hands-on R coding practice. We hope this will be the beginning of
your journey in mediation analysis and open the door to more interesting
research studies!

::: callout-note
## Learning outcomes
Expand Down Expand Up @@ -46,7 +49,9 @@ During this 75-minute course, you will learn about traditional mediation approac

## Important things before the course

To make the most of our training course in Bangkok, please complete the pre-course tasks before you arrive. This will ensure we can start our sessions smoothly and dive right into the content!
To make the most of our training course in Bangkok, please complete the
pre-course tasks before you arrive. This will ensure we can start our
sessions smoothly and dive right into the content!

## Course outline

Expand All @@ -58,8 +63,14 @@ To make the most of our training course in Bangkok, please complete the pre-cour

## Acknowledgement

This course is developed based on 'Mediation Analysis Course' developed by Daniel B. Ibsen, Omar Silverman, Jie Zhang from Steno Diabetes Center Aarhus in Denmark, and Nima Hejarzi and Ivan Diaz from the US, which is sponsored by the Danish Diabetes and Endocrine Academy.
This course is developed based on 'Mediation Analysis Course' developed
by Daniel B. Ibsen, Omar Silverman, Jie Zhang from Steno Diabetes Center
Aarhus in Denmark, and Nima Hejarzi and Ivan Diaz from the US, which is
sponsored by the Danish Diabetes and Endocrine Academy.

The repository contains the lesson, lecture, and assignment material for the course, including the website source files and other associated course administration files. You can always go to check the website to learn more about mediation.
The repository contains the lesson, lecture, and assignment material for
the course, including the website source files and other associated
course administration files. You can always go to check the website to
learn more about mediation.

[https://analysis-of-mechanisms.netlify.app/https://analysis-of-mechanisms.netlify.app/](https://analysis-of-mechanisms.netlify.app/)
[https://analysis-of-mechanisms.netlify.app/https://analysis-of-mechanisms.netlify.app/](https://analysis-of-mechanisms.netlify.app/)
2 changes: 1 addition & 1 deletion index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pak::pkg_install("ggplot2")

## Building the course

The course material was created using [Quarto](https://quarto.org/) to write the lessons and create the book format, [GitHub](https://github.com/) to host the [Git](https://git-scm.com/) repository of the material, and [GitHub Actions](https://github.com/features/actions) with [Netlify](https://www.netlify.com/) to create and host the website. The original source material for this course is found on the [`steno-aarhus/mediation-analysis-course`](https://github.com/steno-aarhus/IDEG-mediation-course) GitHub repository.
The course material was created using [Quarto](https://quarto.org/) to write the lessons and create the book format, [GitHub](https://github.com/) to host the [Git](https://git-scm.com/) repository of the material, and [GitHub Actions](https://github.com/features/actions) to create and host the website. The original source material for this course is found on the [`steno-aarhus/mediation-analysis-course`](https://github.com/steno-aarhus/IDEG-mediation-course) GitHub repository.

## Re-use and licensing {#licensing}

Expand Down
97 changes: 0 additions & 97 deletions sessions/2.motivation-for-mediation-analysis.qmd

This file was deleted.

Loading