Skip to content

Repository files navigation

TidyTuesday in Typst

TidyTuesday in Typst — weekly figures with Gribouille.

My weekly TidyTuesday figures, drawn entirely in Typst with Gribouille, a grammar-of-graphics package.

Live gallery: https://m.canouil.dev/tidytuesday.

Layout

Each entry sits under tidytuesday/year/month/day matching the dataset's date.

tidytuesday/2026/05/26/
├── index.qmd     # gallery page; embeds the figure and its Typst source
├── _plot.typ     # Typst figure (the leading "_" keeps Quarto from rendering it directly)
└── data/*.csv    # the week's downloaded data

The figure is compiled at render time by the typst-render Quarto extension, which turns the {typst} block in index.qmd into light and dark SVGs (plot-light.svg, plot-dark.svg) that follow the site theme. Those SVGs are build artifacts (git-ignored), so there is no separate compile step and no committed image.

Shared assets live under assets/:

assets/
├── brand/_brand.yml        # colour palette shared with figures
├── listings/gallery.ejs.md # custom gallery listing template (read as markdown)
├── og-card.png             # social card (committed; built from typst/social-card.typ)
├── typst/social-card.typ   # social card source (Typst + Gribouille)
└── scss/
    ├── theme.scss          # custom complete theme (default / light)
    └── theme-dark.scss     # dark overrides, layered on top

Fonts come from Bunny Fonts (GDPR-friendly), linked in the page head.

Social card

assets/og-card.png is the site-wide Open Graph / Twitter image (entries override it with their own figure). It is built from Typst with the Quarto-bundled compiler and committed (CI runners lack the Inter font):

scripts/build-card.sh   # regenerate assets/og-card.png after editing the source

Add a week

scripts/new-week.sh 2026-05-26   # create the folder and fetch the CSV(s)
# edit tidytuesday/2026/05/26/_plot.typ to map the real columns
quarto preview                   # browse locally; figures compile on render

new-week.sh needs gh, jq, and curl. The pre-render hook runs scripts/install-gribouille.sh, which installs the latest Gribouille development build into Typst's local package namespace, pinned to the constant version 0.0.0 so the import in assets/typst/_preamble.typ never changes (network required). It skips the download when 0.0.0 is already installed; set GRIBOUILLE_FORCE_UPDATE=1 to refresh.

Tooling

  • Typst 0.14.2.
  • Gribouille development build, pinned locally as 0.0.0 (CeTZ 0.5 backend); the social card stays on Gribouille 0.1.0.
  • Quarto 1.9.37.

Publishing

Pushes to main trigger .github/workflows/publish.yml, which renders the site and deploys it to GitHub Pages. The custom domain m.canouil.dev is configured in the repository's Pages settings.

Licence

CC BY-NC-SA 4.0. Source datasets belong to their respective TidyTuesday curators.

About

Weekly TidyTuesday figures drawn in Typst with Gribouille.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages