-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
76 lines (61 loc) · 2.4 KB
/
justfile
File metadata and controls
76 lines (61 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Coding Agents Cheat Sheets - Build System
# Requires: marp-cli (npm install -g @marp-team/marp-cli)
# Build version - defaults to date stamp
# Override with: just version=v2.0 build
# Or set VERSION env var: VERSION=v2.0 just build
version := env_var_or_default("VERSION", `date +%Y-%m-%d`)
# Common marp options
marp_opts := "--allow-local-files --theme-set themes/"
# Sheet names
sheets := "terms claude-code gemini-cli codex-cli opencode"
# Default recipe - show available commands
default:
@just --list
# Build a single sheet with version substitution
[private]
_build-sheet sheet format outdir:
@mkdir -p {{outdir}}
@sed 's/__VERSION__/{{version}}/g' sheets/{{sheet}}.md | marp -o {{outdir}}/{{sheet}}.{{format}} {{marp_opts}}
# Build all cheat sheets as PDFs
build:
@echo "Building PDF cheat sheets ({{version}})..."
@for sheet in {{sheets}}; do just _build-sheet $sheet pdf dist/pdf; done
@echo "PDFs built in dist/pdf/"
# Build all cheat sheets as HTML
build-html:
@echo "Building HTML cheat sheets ({{version}})..."
@for sheet in {{sheets}}; do just _build-sheet $sheet html dist/html; done
@echo "HTML files built in dist/html/"
# Build all cheat sheets as PNG images (to .github/assets for README)
build-png:
@echo "Building PNG cheat sheets ({{version}})..."
@for sheet in {{sheets}}; do just _build-sheet $sheet png .github/assets; done
@echo "PNGs built in .github/assets/"
# Build all formats
build-all: build build-html build-png
@echo "All formats built!"
# Clean build with cache cleared
build-clean:
@rm -rf dist
@just build
# Run marp preview server (note: version placeholder won't be substituted)
run:
@echo "Starting Marp preview server..."
marp sheets/ --server --allow-local-files --theme-set themes/
# Open the dist folder
open:
@open dist/pdf/ 2>/dev/null || xdg-open dist/pdf/ 2>/dev/null || echo "Open dist/pdf/ manually"
# Build a single sheet (usage: just build-one gemini-cli)
build-one sheet:
just _build-sheet {{sheet}} pdf dist/pdf
@echo "Built dist/pdf/{{sheet}}.pdf"
# Lint markdown files
lint:
@echo "Checking markdown syntax..."
@for sheet in {{sheets}}; do sed 's/__VERSION__/{{version}}/g' sheets/$sheet.md | marp {{marp_opts}} 2>&1 | grep -i error || true; done
@echo "Lint complete"
# Show version info
version:
@echo "Build version: {{version}}"
@echo "Marp CLI version:"
@marp --version