|
| 1 | +## GIBZ Template Package |
| 2 | + |
| 3 | +A template package providing reusable components for teaching and learning material at [GIBZ](https://www.gibz.ch). |
| 4 | +It comes with a configurable document setup (`gibz-conf`) and a collection of styled components such as tasks, hints, supplementary material, and more. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Features |
| 9 | + |
| 10 | +- 📄 **Configurable document layout** with title page, table of contents, and headers/footers. |
| 11 | +- 🎨 **Consistent styling** through a `base_box` and `icon_box` system. |
| 12 | +- ✏️ **Task component** with badges for time, social form, results recording, and evaluation. |
| 13 | +- 💡 **Hint**, ❓ **Question**, 🎬 **Video**, 📖 **Supplementary Material** boxes. |
| 14 | +- 🔳 **Black code box** for highlighting code snippets. |
| 15 | +- 🌍 **Built-in i18n** (currently German and English). |
| 16 | +- 🧩 Exposed via a **flat prefixed API** (`gibz-task`, `gibz-hint`, …) and an optional `GIBZ` namespace. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Quick Start |
| 21 | + |
| 22 | +Create a new project from this template in the Typst CLI: |
| 23 | + |
| 24 | +```sh |
| 25 | +typst init @preview/gibz-script:0.1.0 |
| 26 | +``` |
| 27 | + |
| 28 | +Or in the [Typst web app](https://typst.app): |
| 29 | +**New → From Template → GIBZ**. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +### Import the flat API (recommended) |
| 36 | + |
| 37 | +```typst |
| 38 | +#import "@preview/gibz-script:0.1.0": gibz-conf, gibz-task, gibz-supplementary |
| 39 | +
|
| 40 | +#show: gibz-script( |
| 41 | + moduleNumber: 114, |
| 42 | + moduleTitle: "Codierungs-, Kompressions- und Verschlüsselungsverfahren einsetzen", |
| 43 | + documentTitle: "Skript", |
| 44 | + language: "de", |
| 45 | + doc: { |
| 46 | + #gibz-hint("Dieses Skript wurde mit Typst geschrieben :-)") |
| 47 | + #gibz-supplementary([Cheat Sheet]) |
| 48 | + } |
| 49 | +) |
| 50 | +``` |
| 51 | + |
| 52 | +### Or use the namespaced API |
| 53 | + |
| 54 | +```typst |
| 55 | +#import "@preview/gibz-script:0.1.0": GIBZ |
| 56 | +
|
| 57 | +#show: GIBZ.script( |
| 58 | + moduleNumber: 114, |
| 59 | + moduleTitle: "Codierungs-, Kompressions- und Verschlüsselungsverfahren einsetzen", |
| 60 | + documentTitle: "Skript", |
| 61 | + language: "de", |
| 62 | + doc: { |
| 63 | + #GIBZ.hint("Dieses Skript wurde mit Typst geschrieben :-)") |
| 64 | + #GIBZ.supplementary([Cheat Sheet]) |
| 65 | + } |
| 66 | +) |
| 67 | +``` |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## API Reference |
| 72 | + |
| 73 | +### Configuration |
| 74 | + |
| 75 | +- `gibz-conf(moduleNumber, moduleTitle, documentTitle, language, doc)` |
| 76 | + Wraps your document with title page, table of contents, headers/footers, and base styles. |
| 77 | + |
| 78 | +### Components |
| 79 | + |
| 80 | +- `gibz-task(...)` – exercise/task box with time, social form, recording, evaluation. |
| 81 | +- `gibz-hint(content)` – hint box with 💡 icon. |
| 82 | +- `gibz-question(question, task: none)` – question box with ❓ icon, optional task description. |
| 83 | +- `gibz-video(url, title, description: none)` – video reference with 🎬 icon. |
| 84 | +- `gibz-supplementary(body, title: none)` – supplementary material box with 📖 icon. |
| 85 | +- `gibz-black_code_box(body, codly-opts: (:), box-opts: (:))` – code box with dark background. |
| 86 | + |
| 87 | +### Utilities |
| 88 | + |
| 89 | +- `gibz-base_box(body, style: (:))` – low-level styled container. |
| 90 | +- `gibz-icon_box(icon, content, style: (:))` – container with icon + content layout. |
| 91 | +- `gibz-colors.blue` – standard accent color. |
| 92 | +- `gibz-t(key, lang: none)` – translation lookup (DE/EN). |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Localization |
| 97 | + |
| 98 | +The package supports German (`de`) and English (`en`) for static labels (e.g., _Exercise_, _Supplementary Material_, _Table of Contents_). |
| 99 | +The language is set via `gibz-conf(language: "de" | "en")`. |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## License |
| 104 | + |
| 105 | +This package is licensed under the [MIT-0 License](LICENSE), allowing reuse with minimal restrictions. |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Contributing |
| 110 | + |
| 111 | +Issues and pull requests are welcome! |
| 112 | +The source is maintained on [GitLab](https://gitlab.com/GIBZ/public/typst-template), with mirrored contributions published to [Typst Universe](https://github.com/typst/packages). |
0 commit comments