diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a7235ea --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,82 @@ +Contributing to solo-lu-df + +Thanks for your interest in contributing! The project follows a simple, +developer-friendly workflow. Below are recommended steps, conventions and +checks to make your contribution smooth and easy to review. + +Getting started + +1. Fork the repository and create a branch for your change: + - `git checkout -b feat/short-description` or `git checkout -b fix/short-description` +2. Make changes locally and run the example build to check layout: + - `typst compile examples/qualification-thesis/main.typ` + - or run `typst watch` while editing. + +Reporting issues + +- Open issues for bugs, layout regressions, feature requests or missing + functionality. +- Provide: + - A short description of the problem. + - Steps to reproduce (file paths, commands). + - Expected vs actual behavior and screenshots/PDF snippets if helpful. +- Use labels to categorize the issue (bug, enhancement, docs, etc.) if you + have permission; otherwise maintainers will tag. + +Pull requests + +- Base branch: open PRs against `main` (or other default branch). +- PR title: use a brief prefix + summary, e.g., `feat: add attachment helper` + or `fix: correct table caption numbering`. +- Describe in the PR: + - What you changed and why. + - Any user-facing changes or migration steps. + - How to test (commands to run). +- Include before/after screenshots for visual changes. + +Code style & formatting + +- Typst source: keep the style consistent with existing files. +- Shell examples: use fenced code blocks with `bash`. +- Keep commits small and focused; rebase/squash as needed to keep history clean. + +Testing / validation + +- Verify examples compile cleanly: + - `typst compile template/main.typ` + - `typst compile examples/qualification-thesis/main.typ` +- If you add diagrams or images, include both source (.drawio/.fig/.svg source) + and exported assets (SVG/PDF), and update README/examples as needed. + +Diagrams & assets + +- If you add diagram images exported from draw.io / Figma / Inkscape: + - Commit the source file (e.g., `.drawio`) AND the exported SVG/PDF. + - Prefer SVG/PDF exports for vector quality; ensure fonts are embedded or + text converted to outlines if needed for consistent rendering. +- If you add Typst-native diagrams (fletcher), keep styles consistent with + existing helpers. + +Release & versioning + +- Follow semantic versioning for releases. +- Update `typst.toml` version and changelog when preparing a release. + +License & copyright + +- All contributions are under the project MIT-0 license. +- Don’t include third-party assets without compatible licensing. If you add + third-party assets, note the attribution and license in your PR. + +Communication + +- For large features or breaking changes, open an issue first to discuss the + design; this avoids wasted work and speeds up review. + +Need help? + +- Open an issue and tag it `help wanted` or `question`. Maintainers + will respond with guidance. + +Thank you for contributing -- every fix, test, example and doc update helps +make the template better for students and authors. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2440c75 --- /dev/null +++ b/LICENSE @@ -0,0 +1,16 @@ +MIT No Attribution + +Copyright 2025 Kristofers Solo + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ee0778c --- /dev/null +++ b/README.md @@ -0,0 +1,87 @@ +# solo-lu-df + +A Typst template to write qualification papers, bachelor’s theses, and master’s +theses for Latvijas Universitāte (Faculty of Exact Sciences, Computer Science). +The package provides university-compliant layout rules, helpers for +title/abstract/attachments, and a ready-to-edit example. + +## Usage + +Use the template in the Typst web app by clicking "Start from template" and +searching for `solo-lu-df`, or initialize a new project with the CLI: + +```bash +typst init @preview/solo-lu-df +``` + +Typst will create a new directory with the files needed to get started. + +## Configuration + +This template exports the `ludf` function which accepts named arguments to +configure the whole document and `attachment` helper function. Important arguments: + +- `title`: Document title (content). +- `authors`: Array of author dictionaries. Each author must have `name` and + `code` and may include `location` and `email`. +- `advisors`: Array of advisor dictionaries with `title` and `name`. +- `reviewer`: Reviewer dictionary with `name`. +- `thesis-type`: e.g., `"Bakalaura darbs"`, `"Kvalifikācijas Darbs"`. +- `date`: `datetime(...)` value for the thesis date. Defaults to `today`. +- `place`: Place string (e.g., `"Rīga"`). +- `abstract`: A record with `primary` and `secondary` abstracts. Each has + `text` (content) and `keywords` (array) as well as `title`, `lang` and `keyword-title`. +- `bibliography`: Result of `bibliography("path/to/file.yml")` or `none`. +- `attachments`: Tuple of `attachment(...)` items (tables, figures). +- Positional argument: the document body follows the `ludf.with(...)` call. + +The function also accepts a single, positional argument for the body of the paper. + +The template will initialize your package with a sample call to the `ludf` +function in a show rule. If you want to change an existing project to use this +template, you can add a show rule like this at the top of your file: + +```typst +#import "@preview/solo-lu-df:0.1.0": * + +#show: ludf.with( + title: "Darba Nosaukums", + authors: ( + (name: "Jānis Bērziņš", code: "jb12345", email: "jb12345@edu.lu.lv"), + ), + advisors: (title: "Mg. dat.", name: "Ivars Ozoliņš"), + date: datetime(year: 2025, month: 1, day: 1), + place: "Rīga", + bibliography: bibliography("bibliography.yml"), + abstract: ( + primary: (text: [ Anotācijas teksts... ], keywords: ("Foo", "Bar")), + secondary: (text: [ Abstract text... ], keywords: ("Foo", "Bar")), + ), + attachments: ( + attachment( + caption: "Attachment table", + label: , + table( + columns: (1fr, 1fr), + [Column 1], [Column 2], + ), + ), + ), +) + +// Your content goes below. +``` + +## Tips + +- Install the fonts used by the template (Times family, JetBrains Mono) to + reproduce exact layout, or change font names in `src/lib.typ`. You can + override font by setting [text font](https://typst.app/docs/reference/text/text#parameters-font) to your desired one. +- Bibliography: use Typst's `bibliography(...)` call with a YAML or Bib file. +- Diagrams: the example imports the fletcher package and includes small + helpers under `examples/.../utils/`, but you can also use exported + images from draw.io (diagrams.net) or any other diagram editor. + +## License + +This project is licensed under the MIT-0 License - see the [LICENSE](./LICENSE) file for details. diff --git a/examples/qualification-thesis/README.md b/examples/qualification-thesis/README.md new file mode 100644 index 0000000..0f7b82c --- /dev/null +++ b/examples/qualification-thesis/README.md @@ -0,0 +1,23 @@ +Qualification thesis example (solo-lu-df) + +This folder contains a ready-to-edit qualification-thesis example built with +the `solo-lu-df` Typst template: + +- `main.typ` — Typst source (the example document). +- `bibliography.yml` — example bibliography entries. +- `utils/` — helper snippets for diagrams/tables used by the example. + +## How to edit + +Open `examples/qualification-thesis/main.typ` and modify the `ludf.with(...)` +call to change title, authors, advisors, date, place, abstract, bibliography, +and attachments. The example demonstrates: + +- Title/author/advisor metadata +- Primary and secondary abstracts with keywords +- Attachments (tables) +- Simple DPD/ER diagrams via `fletcher` or external images and local helpers + +## License + +This project is licensed under the MIT-0 License - see the [LICENSE](./../../LICENSE) file for details.