|
| 1 | +# Project Instructions |
| 2 | + |
| 3 | +Brilliant CV is a **Typst package** (`@preview/brilliant-cv`) for creating modular, multilingual CVs and cover letters. Published to Typst Universe. |
| 4 | + |
| 5 | +## Before You Start |
| 6 | + |
| 7 | +Run `just link` before any local development. This registers the local package with Typst's resolver. Without it, all imports fail. Run `just` to see all available commands. |
| 8 | + |
| 9 | +## Critical Architecture |
| 10 | + |
| 11 | +**`src/` is the published package. `template/` is the user-facing starter project.** They are separate concerns: |
| 12 | +- `src/lib.typ` — Package entry point, exports `cv()` and `letter()` |
| 13 | +- `template/metadata.toml` — Central configuration file, drives all customization |
| 14 | +- `template/modules_<lang>/` — Content files per language |
| 15 | + |
| 16 | +Changes to `src/` affect all downstream users. Never break backward compatibility without a deprecation path. |
| 17 | + |
| 18 | +## Things You Will Get Wrong Without Reading This |
| 19 | + |
| 20 | +### Deprecated parameters use panic(), not silent aliasing |
| 21 | +In `src/lib.typ`, deprecated parameters trigger `panic()` with migration instructions. This is **intentional** — do not "fix" these panics. Example: `profilePhoto` → `profile-photo`. |
| 22 | + |
| 23 | +### Some files are auto-generated — do not edit manually |
| 24 | +- `docs/web/docs/api-reference.md` ← generated from `src/` doc-comments |
| 25 | +- `docs/web/docs/configuration.md` ← generated from `template/metadata.toml` comments |
| 26 | + |
| 27 | +Regenerate with `just docs-generate`. Edit the **source comments**, not the output files. |
| 28 | + |
| 29 | +### metadata.toml is the single source of truth |
| 30 | +All user configuration flows through `template/metadata.toml`. Its comments drive docs generation. When adding config options, update the comments in metadata.toml — the rest is derived. |
| 31 | + |
| 32 | +### Language handling has a non-Latin branch |
| 33 | +Languages zh, ja, ko, ru trigger different font handling via `_is-non-latin()` in src/. Test with at least one non-Latin language when touching font or layout code. |
| 34 | + |
| 35 | +## Conventions |
| 36 | + |
| 37 | +- Conventional commits (`feat:`, `fix:`, `docs:`, etc.) |
| 38 | +- Run `just build` before committing to verify compilation |
| 39 | +- Don't commit PDFs (handled by .gitignore and pre-commit hooks) |
| 40 | +- Use `just compare` for visual regression testing before public-facing changes |
| 41 | +- Read `CONTRIBUTING.md` for the full contribution workflow |
0 commit comments