CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Repository Is

This is the source for rweekly.org, a weekly community-curated newsletter about the R programming language. It is a Jekyll-based static site hosted on GitHub Pages (gh-pages branch is the main branch).

Site Architecture

  • Jekyll site: _config.yml configures the site, _layouts/ holds HTML templates, _includes/ holds partials and static assets (CSS/JS vendored inline).
  • Published posts: _posts/ — one Markdown file per weekly issue, named YYYY-MM-DD-<issue>.md.
  • Current draft: draft.md — the live working draft for the next issue. Contributors submit PRs adding links here.
  • RSS feed list: rss_feeds.csv — CSV with columns URL, ENABLE, TWITTER. New blog feeds are added here (set ENABLE=1).
  • R scripts: scripts/ — automation scripts for content collection and processing.

Draft Post Format

Links in draft.md (and posts) use this format:

+ [Title](URL) - optional description

![Optional image alt text](image-URL)

Sections in the draft: Highlight, Insights, R in the Real World, R in Organizations, R in Academia, Tutorials, Resources, New Packages, Updated Packages, Videos and Podcasts, Gist & Cookbook, Shiny Apps, Upcoming Events. Editors vote for the Highlight section — contributors should not add content there.

Images must be HTTPS and hosted at https://raw.githubusercontent.com/. Do not add images directly to this repo (keeps repo size small).

R Scripts

All scripts are run from the repo root directory.

Script Purpose
scripts/curatinator.R Scrapes enabled RSS feeds (rss_feeds.csv) for posts from the last 6 days, fetches new/updated CRAN packages from CRANberries, and writes curatinator_latest.md
scripts/get_rss.R Helper used by curatinator.R — fetches and filters RSS posts by date and reachability
scripts/find_duplicates.R Checks draft.md for links already present in the last ~20 published posts
scripts/parse_curinator.R Parses curatinator_latest.md into a tidy data frame
scripts/process_curinator.R Uses ellmer + OpenAI to classify RSS posts as R-related
scripts/gen_json.R Parses _posts/ into JSON files in temp_json/ for the live index
check_url.R URL health check — used by Travis CI to verify links in posts and draft
scripts/build.R Generates default.nix via the rix package for a Nix-based dev environment

Run the curatinator to collect content for a new issue:

Rscript -e 'source("scripts/curatinator.R")'

Check for duplicate links before publishing:

Rscript -e 'source("scripts/find_duplicates.R"); get_dups()'

GitHub Actions

.github/workflows/actions.yml — runs curatinator.R automatically every Saturday at 09:00 UTC, commits the result to curatinator_latest.md.

Nix Dev Environment

A default.nix is generated by scripts/build.R using the rix package (R 4.5.1). It includes all R package dependencies and system packages (quarto, chromium, curl, imagemagick), plus two GitHub-only packages: rweekly.tools and rweekly.highlights.

Jekyll / Site Build

Build and serve locally with standard Jekyll:

bundle install
bundle exec jekyll serve

CI (Travis) runs Rscript check_url.R on gh-pages branch commits to validate links. Fails if more than 300 broken links are found.

Contributing Workflow

  1. Add links to draft.md under the appropriate section.
  2. Submit a PR against gh-pages.
  3. The PR template asks contributors to identify which section(s) the content belongs to.
  4. Editors merge PRs and handle the weekly release (freeze on Sunday, publish Monday).
  5. To add an RSS feed permanently, add a row to rss_feeds.csv with ENABLE=1.