Reproduce This Project
This site is built with Quarto. Because the project pages execute both Python and R code, reproducing the build requires restoring both environments.
This guide covers two scenarios:
- Reproduce the full website — restore every environment and render the complete site.
- Reproduce a single project — rebuild one project page on its own, without the surrounding site.
Reproduce the Full Website
Prerequisites
- Quarto CLI 1.4+
- Python 3.12, via either conda or the built-in
venv - R 4.x with
renvfor the R code
Clone the Repository
git clone https://github.com/pinn32/pinn32.github.io.git
cd pinn32.github.ioRestore the Environments
R:
install.packages("renv") # if needed
renv::restore(lockfile = "envs/renv.lock")Python (pick one). Both create an environment named dv-env and need Python 3.12.
Option A, conda:
conda env create -f envs/environment.yml
conda activate dv-envOption B, venv + pip:
python3.12 -m venv dv-env
source dv-env/bin/activate # Windows: dv-env\Scripts\activate
pip install -r envs/requirements.txtConfirm that Quarto is using the correct Python interpreter:
quarto check jupyter
# Path: /path/to/your/envs/dv-env/bin/pythonPreview Locally
With both environments restored, start the local development server:
quarto previewDeploy to GitHub Pages
To publish your own copy, first point the remote at your repository:
git remote set-url origin https://github.com/<your-username>/<repo>Update site-url in _quarto.yml to match your GitHub Pages address:
website:
site-url: https://<your-username>.github.io/<repo>Then publish:
quarto publish gh-pagesReproduce a Single Project
The prerequisites above still apply.
Download the files for the project you want to rebuild — for example, /en/projects/student-media-usage/index.qmd. Where relevant, also retrieve the source dataset from /src/data/ and any images from /src/img/.
Using student-media-usage as an example, you can either keep the .qmd extension or convert the file to .Rmd.
To keep the .qmd extension, adjust the YAML options as follows:
title: 'Student Social Media Usage and Well-being Analysis'
author: 'Pinn Xu'
date: '2026-02-23'
format:
html:
code-fold: true
highlight-style: pygments
theme: flatly
toc: true
toc-location: rightThen run quarto render to build the HTML.
To convert the file to .Rmd, adjust the YAML options as follows:
---
title: 'Student Social Media Usage and Well-being Analysis'
author: 'Pinn Xu'
date: '2026-02-23'
output:
html_document:
code_folding: hide
highlight: "pygments"
theme: "sandstone"
toc: true
toc_float:
collapsed: true
---Then click Knit in RStudio, or run rmarkdown::render("index.Rmd") in the R console to build the HTML.
Fetch Change Log from Notion Database
Replace "database_id" in scripts/notion-changelog.json with your own database ID, then run:
python3 scripts/sync-changelog.py --strictCreate your own Notion connection token at Notion Developers, copy the “Secret” value and store it as the environment variable NOTION_TOKEN=... (e.g. in ~/.zshrc).