- Typst 100%
|
|
||
|---|---|---|
| examples | ||
| template | ||
| tests | ||
| .gitignore | ||
| lib.typ | ||
| LICENSE | ||
| PUBLISHING.md | ||
| README.md | ||
| thumbnail.png | ||
| typst.toml | ||
Codenames — Typst edition
Generate a printable Codenames board (player card + solution card) from a word list — no install, no terminal, just edit and export.
Quick start (no install)
- Open typst.app, click Start from template, and search for codenames.
- You'll get a working board immediately, rendered from example words.
- Edit the
wordslist and the settings at the top of the file to your own game. - Export as PDF.
Quick start (local CLI)
typst init @preview/codenames
cd codenames
typst compile main.typ game.pdf
Then edit main.typ and recompile whenever you change something (typst watch main.typ recompiles live as you save).
Settings reference (codenames-board)
All of these are plain variables at the top of main.typ:
| Setting | Default | Description |
|---|---|---|
words |
— | Array of at least grid-size × grid-size words |
seed |
42 |
Any whole number — change it to get a different board |
grid-size |
5 |
5 for a 5×5 grid, 4 for 4×4, etc. |
n-blue |
10 |
Number of blue (team) words |
n-assassin |
1 |
Number of assassin (instant-loss) words |
shuffle-positions |
true |
false keeps words in the order you typed them |
title |
"CODENAMES" |
Player card title — "" hides it |
print-friendly |
false |
true for a black & white, ink-saving version |
Neutral cards fill the remaining slots automatically (grid-size² − n-blue − n-assassin).
There's no "randomize on every compile" button — Typst deliberately exposes no clock or entropy
source finer than the calendar date to keep compiles reproducible, so the only way to get a new
board is to change seed to a different number yourself.
Cover cards
A second function, cover-cards, generates double-sided cut-out cover cards that fit over the word cards (e.g. to add a logo or team color to the back of each card):
#import "@preview/codenames:0.1.0": cover-cards
#show: cover-cards.with(
color1: "blue", // front color — a name (see below) or a hex code like "#1a5fa8"
color2: "tan", // back color
label: "TEAM", // optional text printed on every card
logo: image("logo.png", fit: "contain"), // optional image — must be built with `image(...)` yourself,
// so it resolves relative to *your* file
title: "Cover Cards", // optional page title
grid-size: 5,
)
Named colors: blue, darkblue, red, darkred, green, tan, beige, black, white, gray, yellow, orange, purple.
License
MIT-0 — use, modify, and print freely.
