Add header with version

This commit is contained in:
Constantin Gierczak--Galle 2024-09-15 19:57:15 +02:00
parent 411d2f454b
commit 9a1b96218b
No known key found for this signature in database
2 changed files with 34 additions and 11 deletions

34
epi.typ
View file

@ -1,18 +1,40 @@
#import "lib/libepi.typ" #import "lib/libepi.typ"
// Update version after each meaningful change
#let version = "0.3"
#set document(title: "Fiche EPI de HackENS", author: "cst1") #set document(title: "Fiche EPI de HackENS", author: "cst1")
#set text(font: "Liberation Sans") #set text(font: "Liberation Sans")
#let fiches = ( #let fiches = (
libepi.card(name: "Défonceuse", instructions: "truc truc truc", protection_items: libepi.card(name: "Défonceuse",
(libepi.Hearing, libepi.Shield, libepi.Mask), forbidden_items: (), referent: "cst1", protection_items: (libepi.Hearing, libepi.Shield),
min_help: 1), forbidden_items: (),
referent: "cst1",
instructions: "truc truc truc",
min_help: 1
),
libepi.card(name: "Ponceuse à bande",
protection_items: (libepi.Hearing, libepi.Glasses, libepi.Mask),
forbidden_items: (),
instructions: [
- Vérifier l'état de la bande. Si elle est trop usée, la changer.
- Allumer la ponceuse
- Toujours caler la pièce à poncer contre le bloqueur métallique pour la maintenir en place
],
min_help: 0,
),
libepi.card(name: "Perceuse à colonne", instructions: "", protection_items: libepi.card(name: "Perceuse à colonne",
(libepi.NoGloves,), warning: [Ne surtout pas mettre de gants]), protection_items: (libepi.Glasses,),
forbidden_items: (libepi.NoGloves,),
instructions: [],
warning: [Ne surtout pas mettre de gants, ils risqueraient d'être emportés
avec les mains dans la mèche.]
),
) )
#show: doc => [ #show: doc => [
#libepi.generate_cards(fiches) #libepi.generate_cards(version, fiches)
] ]

View file

@ -34,7 +34,8 @@ instructions: none, note: none, warning: none, min_help: 0) = {
#let NoGloves = build_img("OBLIGATION/INTERDICTION-gants.svg", "Gants") #let NoGloves = build_img("OBLIGATION/INTERDICTION-gants.svg", "Gants")
#let generate_single_card(card) = { #let generate_single_card(version, card) = {
set page(header: [Fiche EPI HackENS v#version])
[ [
#set align(center) #set align(center)
#text(size: 40pt, weight: "bold")[#card.name] #text(size: 40pt, weight: "bold")[#card.name]
@ -65,14 +66,14 @@ instructions: none, note: none, warning: none, min_help: 0) = {
for item in card.protection_items { for item in card.protection_items {
box([ box([
#image(width: 30%, item.img) #image(width: 30%, item.img)
#text(style: "italic", size: 18pt, [#item.caption]) #text(weight: "bold", size: 18pt, [#item.caption])
]) ])
} }
for item in card.forbidden_items { for item in card.forbidden_items {
// TODO: Cross the image // TODO: Cross the image
box([ box([
#image(width: 30%, item.img) #image(width: 30%, item.img)
#text(style: "italic", size: 18pt, [#item.caption]) #text(weight: "bold", size: 18pt, [#item.caption])
]) ])
} }
} }
@ -97,11 +98,11 @@ instructions: none, note: none, warning: none, min_help: 0) = {
info(title: [#text(size:30pt)[Instructions]])[#text(size:18pt)[#card.instructions]] info(title: [#text(size:30pt)[Instructions]])[#text(size:18pt)[#card.instructions]]
} }
#let generate_cards(cards) = { #let generate_cards(version, cards) = {
let total_cards = cards.len() let total_cards = cards.len()
let index = 0 let index = 0
for card in cards { for card in cards {
generate_single_card(card) generate_single_card(version, card)
index += 1 index += 1
if index != total_cards { if index != total_cards {
// Newpage // Newpage