From a05dbee1fbe8cf3d19af25a088b1ac8b78be137d Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Fri, 21 Nov 2025 17:26:23 +0200 Subject: [PATCH] feat: add `display-documentary` parameter Add `display-documentary` parameter determine if documentary page should be displayed or not. --- README.md | 1 + examples/qualification-thesis/main.typ | 2 +- src/lib.typ | 37 ++++++++++++++------------ template/main.typ | 2 +- typst.toml | 2 +- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0663dd4..c134b9f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ configure the whole document and `attachment` helper function. Important argumen `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). +- `display-documentary`: Whether to display the documentary page at the end. Defaults to `true`. - Positional argument: the document body follows the `ludf.with(...)` call. The function also accepts a single, positional argument for the body of the paper. diff --git a/examples/qualification-thesis/main.typ b/examples/qualification-thesis/main.typ index 18ed28b..d832472 100644 --- a/examples/qualification-thesis/main.typ +++ b/examples/qualification-thesis/main.typ @@ -1,6 +1,6 @@ #import "@preview/fletcher:0.5.8" as fletcher: diagram, edge, node #import fletcher.shapes: cylinder, ellipse -#import "@preview/solo-lu-df:0.1.2": * +#import "@preview/solo-lu-df:0.1.3": * #import "utils/tables.typ": function-table #import "utils/diagrams.typ": data-store, dpd-database, dpd-edge, process diff --git a/src/lib.typ b/src/lib.typ index 809c183..0b798f2 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -49,6 +49,7 @@ outline-title: "Saturs", attachments: (), attachment-title: "Pielikumi", + display-documentary: true, body, ) = { // Set document metadata. @@ -283,21 +284,23 @@ make-attachments(attachment-title, attachments) - make-documentary-page( - if type(title) == content { - title - .fields() - .values() - .at(0) - .filter(it => it.func() != linebreak and it != [ ]) - .join(" ") - } else { - title - }, - authors, - advisors, - reviewer, - thesis-type, - date, - ) + if display-documentary { + make-documentary-page( + if type(title) == content { + title + .fields() + .values() + .at(0) + .filter(it => it.func() != linebreak and it != [ ]) + .join(" ") + } else { + title + }, + authors, + advisors, + reviewer, + thesis-type, + date, + ) + } } diff --git a/template/main.typ b/template/main.typ index 25bac2f..60d0e0e 100644 --- a/template/main.typ +++ b/template/main.typ @@ -1,4 +1,4 @@ -#import "@preview/solo-lu-df:0.1.2": * +#import "@preview/solo-lu-df:0.1.3": * #show: ludf.with( title: "Darba Nosaukums", diff --git a/typst.toml b/typst.toml index d538226..dc950e9 100644 --- a/typst.toml +++ b/typst.toml @@ -1,6 +1,6 @@ [package] name = "solo-lu-df" -version = "0.1.2" +version = "0.1.3" entrypoint = "src/lib.typ" authors = ["Kristofers Solo "] license = "MIT-0"