From 08ab18e16ff4931d7cdcd4541c46bb7eaf1ff445 Mon Sep 17 00:00:00 2001 From: Constantin Gierczak--Galle Date: Sun, 15 Sep 2024 15:27:23 +0200 Subject: [PATCH] WIP libepi --- epi.typ | 11 ++- .../OBLIGATION-casque-antibruit.svg | 31 +++++++++ imgs/OBLIGATION/OBLIGATION-casque.svg | 18 +++++ imgs/OBLIGATION/OBLIGATION-chaussures.svg | 21 ++++++ imgs/OBLIGATION/OBLIGATION-combinaison.svg | 16 +++++ imgs/OBLIGATION/OBLIGATION-gants.svg | 23 +++++++ imgs/OBLIGATION/OBLIGATION-lunettes.svg | 21 ++++++ ...IGATION-protection-voies-respiratoires.svg | 24 +++++++ imgs/OBLIGATION/OBLIGATION-visiere.svg | 20 ++++++ lib/libepi.typ | 68 ++++++++++++++++--- 10 files changed, 242 insertions(+), 11 deletions(-) create mode 100644 imgs/OBLIGATION/OBLIGATION-casque-antibruit.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-casque.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-chaussures.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-combinaison.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-gants.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-lunettes.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-protection-voies-respiratoires.svg create mode 100644 imgs/OBLIGATION/OBLIGATION-visiere.svg diff --git a/epi.typ b/epi.typ index 69542ec..b39d6fc 100644 --- a/epi.typ +++ b/epi.typ @@ -1,8 +1,15 @@ #import "lib/libepi.typ" +#set document(title: "Fiche EPI de HackENS", author: "cst1") + #let fiches = ( - libepi.card(name: "Défonçeuse", instructions: "", protection_items: []), - libepi.card(name: "Perceuse à colonne", instructions: "", protection_items: []), + libepi.card(name: "Défonceuse", instructions: "truc truc truc", protection_items: + (libepi.Hearing, libepi.Shield), forbidden_items: (), referent: "cst1", + min_help: 1), + + + libepi.card(name: "Perceuse à colonne", instructions: "", protection_items: +(libepi.Gloves,)), ) #show: doc => [ diff --git a/imgs/OBLIGATION/OBLIGATION-casque-antibruit.svg b/imgs/OBLIGATION/OBLIGATION-casque-antibruit.svg new file mode 100644 index 0000000..dcfbb72 --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-casque-antibruit.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-casque.svg b/imgs/OBLIGATION/OBLIGATION-casque.svg new file mode 100644 index 0000000..f632caf --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-casque.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-chaussures.svg b/imgs/OBLIGATION/OBLIGATION-chaussures.svg new file mode 100644 index 0000000..2214263 --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-chaussures.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-combinaison.svg b/imgs/OBLIGATION/OBLIGATION-combinaison.svg new file mode 100644 index 0000000..d0f7ab7 --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-combinaison.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-gants.svg b/imgs/OBLIGATION/OBLIGATION-gants.svg new file mode 100644 index 0000000..a5120de --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-gants.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-lunettes.svg b/imgs/OBLIGATION/OBLIGATION-lunettes.svg new file mode 100644 index 0000000..aa035de --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-lunettes.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-protection-voies-respiratoires.svg b/imgs/OBLIGATION/OBLIGATION-protection-voies-respiratoires.svg new file mode 100644 index 0000000..710c2d8 --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-protection-voies-respiratoires.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/imgs/OBLIGATION/OBLIGATION-visiere.svg b/imgs/OBLIGATION/OBLIGATION-visiere.svg new file mode 100644 index 0000000..dc8d997 --- /dev/null +++ b/imgs/OBLIGATION/OBLIGATION-visiere.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/lib/libepi.typ b/lib/libepi.typ index 8b8bb54..649de79 100644 --- a/lib/libepi.typ +++ b/lib/libepi.typ @@ -1,27 +1,77 @@ #let dummy(truc) = [truc] // Builds a card from arguments -#let card(name: none, protection_items: [], referent: "Pas de referent", -instructions: none, note: none) = { +#let card(name: none, protection_items: (), forbidden_items: (), referent: "Pas de referent", +instructions: none, note: none, min_help: 0) = { ( name: name, protection_items: protection_items, + forbidden_items: forbidden_items, referent: referent, + min_help: min_help, instructions: instructions, note: note ) } +#let build_img(link, caption) = ( + img: "../imgs/" + link, + caption: caption, +) + // Define bindings for al protection equipment items -#let Hearing = "OBLIGATION/OBLIGATION-casque-antibruit.pdf" -#let Helmet = "OBLIGATION/OBLIGATION-casque.pdf" -#let Glasses = "OBLIGATION/OBLIGATION-lunettes.pdf" -#let Shield = "OBLIGATION/OBLIGATION-visiere.pdf" -#let Gloves = "OBLIGATION/OBLIGATION-gants.pdf" -#let Mask = "OBLIGATION/OBLIGATION-protection-voies-respiratoires.pdf" +#let Hearing = build_img("OBLIGATION/OBLIGATION-casque-antibruit.svg", "Casque anti-bruit") +#let Helmet = build_img("OBLIGATION/OBLIGATION-casque.svg", "Casque") +#let Glasses = build_img("OBLIGATION/OBLIGATION-lunettes.svg", "Lunettes") +#let Shield = build_img("OBLIGATION/OBLIGATION-visiere.svg", "Visière") +#let Gloves = build_img("OBLIGATION/OBLIGATION-gants.svg", "Gants") +#let Mask = build_img("OBLIGATION/OBLIGATION-protection-voies-respiratoires.svg", "Masque") #let generate_single_card(card) = { - text(size: 14pt)[#card.name] + [ + #set align(center) + #text(size: 40pt, weight: "bold")[#card.name] + ] + [ + #text(size: 20pt)[Référent·es: #card.referent] + ] + linebreak() + [ + #let plural = if card.min_help > 0 [s] else [] + #text(size: 20pt)[Utilisation: au moins + #text(weight: "bold")[#str(card.min_help + 1)] personne#plural] + ] + linebreak() + linebreak() + [ + #box([ + #set align(center) + #{ + for item in card.protection_items { + box([ + #image(width: 30%, item.img) + #text(style: "italic", [#item.caption]) + ]) + } + for item in card.forbidden_items { + // TODO: Cross the image + box([ + #image(width: 30%, item.img) + #text(style: "italic", [#item.caption]) + ]) + } + } + ]) + ] + + // TODO: Tidy this up + linebreak() + linebreak() + linebreak() + + text(size: 30pt, weight: "bold")[Instructions] + linebreak() + text(size: 18pt)[#card.instructions] } #let generate_cards(cards) = {