From a354919fcad60de6e0961d61ea2e973973eff4b8 Mon Sep 17 00:00:00 2001 From: maride Date: Thu, 29 Jan 2026 10:59:39 +0100 Subject: [PATCH] Ensure all values to be changed are wrapped in placeholders --- aux/placeholder.typ | 12 ++++++++++++ main.typ | 14 +++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/aux/placeholder.typ b/aux/placeholder.typ index 01e6ea1..2c5b961 100644 --- a/aux/placeholder.typ +++ b/aux/placeholder.typ @@ -14,3 +14,15 @@ } ) } + +// rawPlaceholder returns the very same value and type without altering it. +// Has the ability to panic if panicOnPlaceholder is set to true. +#let rawPlaceholder(value) = { + context( + if panicOnPlaceholder.get() { + panic("Found placeholder and panicOnPlaceholder is set.") + } + ) + + return value +} \ No newline at end of file diff --git a/main.typ b/main.typ index 14912d2..16ba15b 100644 --- a/main.typ +++ b/main.typ @@ -1,7 +1,7 @@ #import "addons/addons.typ" #import "pages/pages.typ" -#import "aux/placeholder.typ": placeholder, panicOnPlaceholder +#import "aux/placeholder.typ": placeholder, rawPlaceholder, panicOnPlaceholder // Project-specific variables #panicOnPlaceholder.update(false) @@ -10,7 +10,7 @@ #let targetFull = placeholder("Ellingson Mineral Corporation") #let targetInSentence = placeholder("Ellingston Mineral") #let reportType = placeholder("Penetration Test Report") -#let creationDate = datetime.today() +#let creationDate = rawPlaceholder(datetime.today()) // Document setup #set document( @@ -45,9 +45,9 @@ // ----- Cover & Legal disclaimer(s) ----- #pages.cover.render(targetFull, place, author, creationDate, reportType, - confidential: false, // set to true for a "CONFIDENTIAL" mark on the cover - tlp: "amber+strict", // set to one of "RED", "AMBER+STRICT", "AMBER", "GREEN", "CLEAR", or none. See https://www.first.org/tlp/ - draft: true // set to true for a "DRAFT" mark on the cover + confidential: rawPlaceholder(false), // set to true for a "CONFIDENTIAL" mark on the cover + tlp: rawPlaceholder("amber+strict"), // set to one of "RED", "AMBER+STRICT", "AMBER", "GREEN", "CLEAR", or none. See https://www.first.org/tlp/ + draft: rawPlaceholder(true) // set to true for a "DRAFT" mark on the cover ) #pages.legal.render(author) @@ -66,7 +66,7 @@ start: placeholder("01.01.1970"), end: placeholder("31.12.1970"), setup: placeholder([Connection to #targetFull was made through a dedicated VPN connection. The inner IP address of the test device was 10.0.0.42.]), - nodes: ``` + nodes: rawPlaceholder(``` digraph G { rankdir=LR; node [shape=rectangle]; @@ -97,7 +97,7 @@ Target4 -> Target8 } } - ```, + ```), scope: ( ( type: "Address", content: placeholder("10.23.42.1"), inScope: true ), ( type: "Address", content: placeholder("2001:db8::2342"), inScope: true ),