Skip to content

Commit fe14037

Browse files
calvinhpclaude
andcommitted
feat: modernize build tooling, themes, and project docs
Migrate SCSS themes from @import to @use/sass:color module syntax, update Makefile for Vite-based Reveal.js builds with automatic plugin copying, fix GitHub Actions workflow raw/endraw placement, and add AGENTS.md and root .gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 53b0477 commit fe14037

9 files changed

Lines changed: 193 additions & 151 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.claude

AGENTS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
This repo is a Cookiecutter template. The root `cookiecutter.json` defines prompts (title, event, year, slug, keywords, author info), and all scaffolded assets live in `{{cookiecutter.presentation_slug}}/`. Inside that directory:
5+
6+
- `slides.md` — Pandoc Markdown source with YAML front matter and Jinja2 template variables.
7+
- `images/` — presentation media (tracked with Git LFS in generated projects).
8+
- `themes/` — SCSS themes (`wildclouds`, `wildclouds_night`, `wildclouds_white`, `minions_white`). During builds, the active theme is copied to `css/theme/` and compiled via Vite.
9+
- `tricks.yaml` — watchdog config for `make watch`.
10+
- `Makefile` — orchestrates Reveal.js fetch, npm install, plugin copying, Pandoc rendering, and dev server.
11+
- `.github/workflows/static.yml` — GitHub Actions workflow (wrapped in `{% raw %}`/`{% endraw %}` Jinja tags) that builds and deploys to GitHub Pages using Pandoc 3.8.2 with LFS support.
12+
13+
The default theme is `wildclouds`, set via the `slide-theme` variable at the top of the Makefile.
14+
15+
## Build, Test, and Development Commands
16+
- `cookiecutter .` scaffolds a new presentation locally; pass the GitHub URL for remote use.
17+
- `nvm install --lts` aligns Node with the expected Reveal.js toolchain.
18+
- `make index.html` fetches Reveal.js (if not present), runs `npm install`, copies built plugins to `plugin/` paths expected by Pandoc's revealjs template, and renders slides via Pandoc.
19+
- `make start` builds then launches the Reveal.js dev server with live reload.
20+
- `make watch` (requires `watchmedo` / `watchdog`) rebuilds whenever Markdown changes; configured via `tricks.yaml`.
21+
- `npm run build:styles` regenerates theme CSS if you touch SCSS sources (the Makefile calls this automatically for the active theme).
22+
- `make clean` removes all Reveal.js artifacts (js/, css/, dist/, node_modules/, etc.) to reset the working directory.
23+
- `make help` prints available Make targets with descriptions.
24+
25+
## Coding Style & Naming Conventions
26+
Author slides in Markdown with Pandoc attributes; prefer fenced blocks and explicit IDs (`# Slide Title {.class}`). Use fenced divs with colons for credits and speaker notes (`::: notes`). Indent YAML front matter with two spaces. Follow SCSS conventions already present: 2-space indentation, descriptive `$variable` names, and import ordering (`@import` template files before custom rules). Name new template files with lowercase-hyphenated or lowercase-underscore patterns to match existing assets (e.g., `wildclouds_night.scss`).
27+
28+
When editing the GitHub Actions workflow, keep the `{% raw %}`/`{% endraw %}` wrapper intact so Jinja2 doesn't interpret GitHub Actions expressions like `${{ }}`.
29+
30+
## Testing Guidelines
31+
There is no automated test suite; rely on manual verification. After edits, run `make index.html` to ensure Pandoc completes without warnings, then use `make start` to review behavior in the browser. If you adjust themes, confirm `dist/theme/<theme>.css` regenerates via `npm run build:styles` and inspect slides for visual regressions. For GitHub Actions changes, verify the workflow YAML is valid and that the `{% raw %}` wrapper is preserved. Document any required manual checks in the generated project's README when you introduce nonstandard behavior.
32+
33+
## Commit & Pull Request Guidelines
34+
Adopt Conventional Commit prefixes (`feat:`, `fix:`, `docs:`) as seen in the history (`feat: enable Git LFS…`). Scope template-only changes with clear descriptions (e.g., `feat: add keynote-style layout`). For pull requests, include: summary of template impact, sample command output or screenshots from a generated project, and links to related issues. Run the relevant `make` targets before submission and note any manual verification performed to help reviewers reproduce results quickly.

{{cookiecutter.presentation_slug}}/.github/workflows/static.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% raw %}
12
# Simple workflow for deploying static content to GitHub Pages
23
name: Deploy Reveal.js Presentation Content to Pages
34

@@ -25,9 +26,9 @@ jobs:
2526
deploy:
2627
environment:
2728
name: github-pages
28-
{% raw %}
29+
2930
url: ${{ steps.deployment.outputs.page_url }}
30-
{% endraw %}
31+
3132
runs-on: ubuntu-latest
3233
steps:
3334
- name: Checkout
@@ -54,9 +55,10 @@ jobs:
5455
mv dist/ _site/
5556
mv plugin/ _site/
5657
- name: Setup Pages
57-
uses: actions/configure-pages@v5
58+
uses: actions/configure-pages@v4
5859
- name: Upload artifact
5960
uses: actions/upload-pages-artifact@v3
6061
- name: Deploy to GitHub Pages
6162
id: deployment
6263
uses: actions/deploy-pages@v4
64+
{% endraw %}

{{cookiecutter.presentation_slug}}/.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ dist/
1212
examples/
1313
.sass-cache
1414
CONTRIBUTING.md
15-
bower.json
1615
css/
17-
gruntfile.js
18-
ignores
1916
js/
20-
lib/
17+
public/
2118
package-lock.json
2219
package.json
2320
plugin/
2421
reveal.js-master/
22+
scripts/
23+
react/
2524
test/
26-
.travis.yml
2725
index.html
2826
.github/
29-
.npmignore
30-
gulpfile.js
27+
tsconfig.json
28+
tsconfig.node.json
29+
vite.config.ts
30+
vite.config.styles.ts

{{cookiecutter.presentation_slug}}/Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@ js/reveal.js:
1414
bsdtar --strip-components=1 --exclude .gitignore --exclude LICENSE --exclude README.md --exclude demo.html --exclude index.html -xf master.zip
1515
rm master.zip
1616
npm install
17+
@# Copy built plugins to paths expected by Pandoc's revealjs template
18+
@for p in notes search zoom math highlight markdown; do \
19+
if [ -f dist/plugin/$$p.js ]; then \
20+
mkdir -p plugin/$$p; \
21+
cp dist/plugin/$$p.js plugin/$$p/$$p.js; \
22+
fi; \
23+
done
1724

18-
css/theme/source/$(slide-theme).scss: themes/$(slide-theme).scss
25+
css/theme/$(slide-theme).scss: themes/$(slide-theme).scss
1926
cp "$<" "$@"
2027

21-
dist/theme/$(slide-theme).css: css/theme/source/$(slide-theme).scss
22-
npm run build -- css-themes
28+
dist/theme/$(slide-theme).css: css/theme/$(slide-theme).scss
29+
npm run build:styles
2330

2431
start: index.html ## bulid presentation and start server
2532
@echo "Starting the local presentation server 🚀"
@@ -28,19 +35,23 @@ start: index.html ## bulid presentation and start server
2835
clean: ## clean up the working directory
2936
rm CONTRIBUTING.md || true
3037
rm LICENSE || true
31-
rm .npmignore || true
3238
rm -rf css/ || true
33-
rm gulpfile.js || true
3439
rm index.html || true
3540
rm -rf examples/ || true
3641
rm -rf js/ || true
37-
rm -rf lib/ || true
42+
rm -rf public/ || true
3843
rm package-lock.json || true
3944
rm package.json || true
4045
rm -rf plugin/ || true
46+
rm -rf scripts/ || true
4147
rm -rf test/ || true
4248
rm -rf node_modules/ || true
4349
rm -rf dist/ || true
50+
rm -rf react/ || true
51+
rm tsconfig.json || true
52+
rm tsconfig.node.json || true
53+
rm vite.config.ts || true
54+
rm vite.config.styles.ts || true
4455

4556
watch: ## Watch for changes and rebuild
4657
@echo "♻️ Watching for changes..."

{{cookiecutter.presentation_slug}}/themes/minions_white.scss

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,51 @@
44
* By Hakim El Hattab, http://hakim.se
55
*/
66

7+
// Load utils
8+
@use 'sass:color';
9+
@use 'template/mixins' as mixins;
710

8-
// Default mixins and settings -----------------
9-
@import "../template/mixins";
10-
@import "../template/settings";
11-
// ---------------------------------------------
11+
$active-color: #2a76dd;
12+
13+
// Inject theme variables (with some overrides)
14+
@use 'template/settings' with (
15+
$background-color: #fff,
16+
17+
$block-margin: 10px,
18+
19+
$main-color: #222,
20+
$main-font-size: 40px,
21+
$main-font: "'Roboto', sans-serif",
22+
23+
$heading-color: #222,
24+
$heading-margin: 0 0 10px 0,
25+
$heading-font: "'Saira Condensed', Impact, sans-serif",
26+
$heading-text-shadow: none,
27+
$heading-letter-spacing: -0.03em,
28+
$heading-line-height: 1,
29+
$heading-text-transform: uppercase,
30+
$heading-font-weight: 900,
31+
32+
$heading1-size: 2.3em,
33+
$heading2-size: 1.7em,
34+
$heading3-size: 1.3em,
35+
$heading4-size: 1.0em,
36+
37+
$code-font: "'Fira Code', monospace",
38+
39+
$link-color: $active-color,
40+
$link-color-hover: color.scale($active-color, $lightness: 15%),
41+
$selection-background-color: color.scale($active-color, $lightness: 25%)
42+
);
43+
44+
// Inject the theme template
45+
@use 'template/theme';
1246

1347
// Include theme-specific fonts
1448
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&family=Roboto&family=Saira+Condensed:wght@900&display=swap');
1549

16-
// Override theme settings (see ../template/settings.scss)
17-
$backgroundColor: #fff;
18-
19-
$blockMargin: 10px;
20-
21-
$mainColor: #222;
22-
$headingColor: #222;
23-
24-
$mainFontSize: 40px;
25-
$mainFont: 'Roboto', sans-serif;
26-
$headingMargin: 0 0 $blockMargin 0;
27-
$headingFont: 'Saira Condensed', Impact, sans-serif;
28-
$headingTextShadow: none;
29-
$headingLetterSpacing: -0.03em;
30-
$headingLineHeight: 1;
31-
$headingTextTransform: uppercase;
32-
$headingFontWeight: 900;
33-
$codeFont: 'Fira Code', monospace;
34-
$linkColor: #2a76dd;
35-
$linkColorHover: lighten( $linkColor, 15% );
36-
$selectionBackgroundColor: lighten( $linkColor, 25% );
37-
38-
$heading1Size: 2.3em;
39-
$heading2Size: 1.7em;
40-
$heading3Size: 1.3em;
41-
$heading4Size: 1.0em;
42-
43-
section.has-dark-background {
44-
&, h1, h2, h3, h4, h5, h6 {
45-
color: #fff;
46-
}
47-
}
50+
// Change text when the background is inverted
51+
@include mixins.dark-bg-text-color(#fff);
4852

4953
.slide-background {
5054
filter: grayscale(50%) opacity(20%) blur(0);
@@ -111,7 +115,3 @@ body:after {
111115
bottom: -14em;
112116
left: -26em;
113117
}
114-
115-
// Theme template ------------------------------
116-
@import "../template/theme";
117-
// ---------------------------------------------

{{cookiecutter.presentation_slug}}/themes/wildclouds.scss

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,11 @@
33
* Author: Achim Staebler
44
*/
55

6+
// Load utils
7+
@use 'sass:color';
8+
@use 'template/mixins' as mixins;
69

7-
// Default mixins and settings -----------------
8-
@import "../template/mixins";
9-
@import "../template/settings";
10-
// ---------------------------------------------
11-
12-
13-
14-
// Include theme-specific fonts
15-
@import url(../../lib/font/league-gothic/league-gothic.css);
16-
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
17-
18-
/**
19-
* Solarized colors by Ethan Schoonover
20-
*/
21-
html * {
22-
color-profile: sRGB;
23-
rendering-intent: auto;
24-
}
25-
26-
// Solarized colors
10+
// Solarized colors by Ethan Schoonover
2711
$base03: #002b36;
2812
$base02: #073642;
2913
$base01: #586e75;
@@ -41,19 +25,36 @@ $blue: #268bd2;
4125
$cyan: #2aa198;
4226
$green: #859900;
4327

44-
// Override theme settings (see ../template/settings.scss)
45-
$mainColor: $base1;
46-
$headingColor: $base2;
47-
$headingTextShadow: none;
48-
$backgroundColor: $base03;
49-
$linkColor: $blue;
50-
$linkColorHover: lighten( $linkColor, 20% );
51-
$selectionBackgroundColor: $magenta;
28+
$active-color: $blue;
29+
30+
// Inject theme variables (with some overrides)
31+
@use 'template/settings' with (
32+
$background-color: $base03,
5233

53-
$heading1Size: 2.3em;
54-
$heading2Size: 1.7em;
55-
$heading3Size: 1.3em;
56-
$heading4Size: 1.0em;
34+
$main-color: $base1,
35+
$heading-color: $base2,
36+
$heading-text-shadow: none,
37+
38+
$heading1-size: 2.3em,
39+
$heading2-size: 1.7em,
40+
$heading3-size: 1.3em,
41+
$heading4-size: 1.0em,
42+
43+
$link-color: $active-color,
44+
$link-color-hover: color.scale($active-color, $lightness: 20%),
45+
$selection-background-color: $magenta
46+
);
47+
48+
// Inject the theme template
49+
@use 'template/theme';
50+
51+
// Include theme-specific fonts
52+
@import url('https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic');
53+
54+
html * {
55+
color-profile: sRGB;
56+
rendering-intent: auto;
57+
}
5758

5859
.slide-background {
5960
filter: grayscale(50%) opacity(20%) blur(2px);
@@ -83,8 +84,3 @@ body:after {
8384
bottom: -9em;
8485
left: -7em;
8586
}
86-
87-
88-
// Theme template ------------------------------
89-
@import "../template/theme";
90-
// ---------------------------------------------

{{cookiecutter.presentation_slug}}/themes/wildclouds_night.scss

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,34 @@
44
* Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
55
*/
66

7+
// Load utils
8+
@use 'sass:color';
9+
@use 'template/mixins' as mixins;
710

8-
// Default mixins and settings -----------------
9-
@import "../template/mixins";
10-
@import "../template/settings";
11-
// ---------------------------------------------
11+
$active-color: #e7ad52;
1212

13+
// Inject theme variables (with some overrides)
14+
@use 'template/settings' with (
15+
$background-color: #111,
1316

14-
// Include theme-specific fonts
15-
@import url(https://fonts.googleapis.com/css?family=Montserrat:700);
16-
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic);
17+
$main-font: "'Open Sans', sans-serif",
1718

19+
$heading-font: "'Montserrat', Impact, sans-serif",
20+
$heading-text-shadow: none,
21+
$heading-letter-spacing: -0.03em,
22+
$heading-text-transform: none,
1823

19-
// Override theme settings (see ../template/settings.scss)
20-
$backgroundColor: #111;
24+
$link-color: $active-color,
25+
$link-color-hover: color.scale($active-color, $lightness: 20%),
26+
$selection-background-color: $active-color
27+
);
2128

22-
$mainFont: 'Open Sans', sans-serif;
23-
$linkColor: #e7ad52;
24-
$linkColorHover: lighten( $linkColor, 20% );
25-
$headingFont: 'Montserrat', Impact, sans-serif;
26-
$headingTextShadow: none;
27-
$headingLetterSpacing: -0.03em;
28-
$headingTextTransform: none;
29-
$selectionBackgroundColor: #e7ad52;
29+
// Inject the theme template
30+
@use 'template/theme';
31+
32+
// Include theme-specific fonts
33+
@import url(https://fonts.googleapis.com/css?family=Montserrat:700);
34+
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic);
3035

3136
.slide-background {
3237
filter: grayscale(50%) opacity(20%) blur(0px);
@@ -48,8 +53,3 @@ $selectionBackgroundColor: #e7ad52;
4853
padding-right: 12px;
4954
}
5055
}
51-
52-
53-
// Theme template ------------------------------
54-
@import "../template/theme";
55-
// ---------------------------------------------

0 commit comments

Comments
 (0)