Essayer d'utiliser les boîtes

This commit is contained in:
Constantin Gierczak--Galle 2024-09-15 15:44:31 +02:00
parent 75eabaf311
commit 497881703e
No known key found for this signature in database
2 changed files with 20 additions and 4 deletions

View file

@ -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 => [

View file

@ -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
)
}
@ -73,6 +76,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()
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) = {