diff --git a/template/unexplrd-mise/.mise/config.toml b/template/unexplrd-mise/.mise/config.toml index 106a84c..18c2eba 100644 --- a/template/unexplrd-mise/.mise/config.toml +++ b/template/unexplrd-mise/.mise/config.toml @@ -19,7 +19,8 @@ work_output_file = "{{config_root}}/main.pdf" nure_package_repo = "https://gitea.linerds.us/pencelheimer/typst_nure_template.git" nure_package_ref = "0.1.1" -nure_package_rev = "af2ba45a16f94b37cae9db0f8fdb915db545498d" + +nure_package_rev = "9abbc7c1e161523145c27a098add79886968547c" nure_package_name = "vendor/nure" nure_package_ver = "{{vars.nure_package_ref}}" @@ -53,10 +54,12 @@ run = """ fi """ -[tasks.copy] +[tasks.rename] depends = ["compile"] run = """ #!/usr/bin/env bash + # Generates the following name from doc.toml: ПЗ1_Прізвище_ПЗПІ-23-2_ПарП.pdf + # Assumes authors.at(0).name to be in the following format: "Прізвище І. Б." final_name=$(mise exec -- yq '.type + (.number | tostring) + "_" + (.authors[0].name | split(" "))[0] + "_" + (.authors[0].edu-program + "-" + .authors[0].group) + "_" + .subject + ".pdf"' "{{vars.work_doc_config}}"); diff --git a/template/unexplrd-mise/README.md b/template/unexplrd-mise/README.md index 474afe0..037e2b3 100644 --- a/template/unexplrd-mise/README.md +++ b/template/unexplrd-mise/README.md @@ -33,7 +33,7 @@ This example has the following structure: All work contents are stored in `src/` to avoid clutter. ### Files -- `src/doc.toml`: work-specific settings, could be auto-filled, see (TODO: add a demo nushell script) +- `src/doc.toml`: work-specific settings, could be auto-filled, useful for scripts, see (TODO: add a demo nushell script) - `src/utils.typ`: utilities and functions used across the project - `src/main.typ`: main entry file @@ -47,6 +47,7 @@ All work contents are stored in `src/` to avoid clutter. ### Tasks - `compile`: Execute `typst compile` on `src/main.typ` - `watch`: Execute `typst watch` on `src/main.typ` +- `rename`: Copy output `.pdf` file with an auto-generated name from metadata in `doc.toml` - `fetch-nure-package`: clone package git repository to a directory specified in `[vars]` - `update-package-rev`: updates `vars.nure_package_rev` with the last commit id from the specified branch (`vars.nure_package_ref`) @@ -75,9 +76,9 @@ All work contents are stored in `src/` to avoid clutter. + МКр: Мережна криміналістика + ОКЗІ: Основи криптографічного захисту інформації + Прог: Програмування - + ТІК: Теорія інформаціі та кодування + + ТІК: Теорія інформації та кодування ``` - To apply it, add the following command to the `fetch_nure_package` task: + To apply it, add the following command to the end of `fetch_nure_package` task: ```sh git -C {{vars.nure_package_path}} apply --check --apply --quiet $MISE_PROJECT_ROOT/custom-subjects.patch || exit 0 ```