Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Compiles the book from the same content the app renders. The PDF lands as
# a workflow artifact on every push to main that touches content or the
# emitter — the printed book can never drift from the live guide.
name: book

on:
push:
branches: [main]
paths:
- 'src/content/**'
- 'scripts/emit-latex.ts'
- '.github/workflows/book.yml'
workflow_dispatch:

jobs:
pdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- name: Emit LaTeX
run: npm run book:tex
- uses: wtfjoke/setup-tectonic@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile PDF
run: tectonic book/gradient-lab.tex
- uses: actions/upload-artifact@v4
with:
name: gradient-lab-pdf
path: book/gradient-lab.pdf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ dist-ssr
*.sln
*.sw?
.claude/launch.json
book/
34 changes: 34 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"build": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
"test": "vitest run"
"test": "vitest run",
"book:tex": "vite-node scripts/emit-latex.ts",
"book": "npm run book:tex && tectonic book/gradient-lab.tex"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.0.0",
Expand All @@ -19,6 +21,7 @@
"svelte-check": "^4.4.6",
"typescript": "^6.0.3",
"vite": "^8.0.10",
"vite-node": "^6.0.0",
"vite-plugin-pwa": "^1.3.0",
"vitest": "^4.1.8"
},
Expand Down
Loading
Loading