From 497881703eeed6970d1f259aac21d734dbcb9f0e Mon Sep 17 00:00:00 2001 From: Constantin Gierczak--Galle Date: Sun, 15 Sep 2024 15:44:31 +0200 Subject: [PATCH] =?UTF-8?q?Essayer=20d'utiliser=20les=20bo=C3=AEtes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epi.typ | 4 ++-- lib/libepi.typ | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/epi.typ b/epi.typ index b39d6fc..553ce88 100644 --- a/epi.typ +++ b/epi.typ @@ -4,12 +4,12 @@ #let fiches = ( libepi.card(name: "Défonceuse", instructions: "truc truc truc", protection_items: - (libepi.Hearing, libepi.Shield), forbidden_items: (), referent: "cst1", + (libepi.Hearing, libepi.Shield, libepi.Mask), forbidden_items: (), referent: "cst1", min_help: 1), libepi.card(name: "Perceuse à colonne", instructions: "", protection_items: -(libepi.Gloves,)), +(libepi.Gloves,), warning: [Ne surtout pas mettre de gants]), ) #show: doc => [ diff --git a/lib/libepi.typ b/lib/libepi.typ index 144e213..35ebe09 100644 --- a/lib/libepi.typ +++ b/lib/libepi.typ @@ -1,9 +1,11 @@ +#import "@preview/gentle-clues:1.0.0": * + #let dummy(truc) = [truc] // Builds a card from arguments #let card(name: none, protection_items: (), forbidden_items: (), referent: none, -instructions: none, note: none, min_help: 0) = { +instructions: none, note: none, warning: none, min_help: 0) = { ( name: name, protection_items: protection_items, @@ -11,7 +13,8 @@ instructions: none, note: none, min_help: 0) = { referent: referent, min_help: min_help, instructions: instructions, - note: note + note: note, + warning: warning ) } @@ -72,6 +75,18 @@ instructions: none, note: none, min_help: 0) = { } ]) ] + + if card.warning != none { + // TODO: Tidy this up + linebreak() + linebreak() + linebreak() + + text(size: 30pt, weight: "bold")[Avertissement] + linebreak() + text(size: 18pt)[#card.warning] + warning(title: [Avertissement])[#card.warning] + } // TODO: Tidy this up linebreak() @@ -81,6 +96,7 @@ instructions: none, note: none, min_help: 0) = { text(size: 30pt, weight: "bold")[Instructions] linebreak() text(size: 18pt)[#card.instructions] + info(title: [#text(size:30pt)[Instructions]])[#text(size:18pt)[#card.instructions]] } #let generate_cards(cards) = {