Improve recipe typst
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
title: "",
|
title: "",
|
||||||
subtitle: none,
|
subtitle: none,
|
||||||
persons: none,
|
persons: none,
|
||||||
|
quantity: none,
|
||||||
preptime: none,
|
preptime: none,
|
||||||
cooktime: none,
|
cooktime: none,
|
||||||
waittime: none,
|
waittime: none,
|
||||||
@@ -38,23 +39,28 @@ align(center, {
|
|||||||
let l = [#v(-0.25em)#line(length: 1.5em, angle: 90deg)]
|
let l = [#v(-0.25em)#line(length: 1.5em, angle: 90deg)]
|
||||||
|
|
||||||
let data = ()
|
let data = ()
|
||||||
if persons != none or persons != 0 {
|
if persons != none and persons != 0 {
|
||||||
data.push([#box([*#persons* pers], baseline: 3.5mm)])
|
data.push([#box([*#persons* pers], baseline: 3.5mm)])
|
||||||
data.push(l)
|
data.push(l)
|
||||||
}
|
}
|
||||||
if preptime != none or preptime == "" {
|
if quantity != none and quantity != 0 {
|
||||||
|
data.push([#box([*#quantity* pièces], baseline: 3.5mm)])
|
||||||
|
data.push(l)
|
||||||
|
}
|
||||||
|
if preptime != none and preptime != "" {
|
||||||
data.push([#box(image.decode(knifesvg, format: "svg", height: 4.7mm), baseline: 1.2mm) *#preptime*])
|
data.push([#box(image.decode(knifesvg, format: "svg", height: 4.7mm), baseline: 1.2mm) *#preptime*])
|
||||||
data.push(l)
|
data.push(l)
|
||||||
}
|
}
|
||||||
if cooktime != none or cooktime == "" {
|
if cooktime != none and cooktime != "" {
|
||||||
data.push([#box(image.decode(ovensvg, format: "svg", height: 4.4mm), baseline: 0.9mm) *#cooktime*])
|
data.push([#box(image.decode(ovensvg, format: "svg", height: 4.4mm), baseline: 0.9mm) *#cooktime*])
|
||||||
data.push(l)
|
data.push(l)
|
||||||
}
|
}
|
||||||
if waittime != none or waittime == "" {
|
if waittime != none and waittime != "" {
|
||||||
data.push([#box(image.decode(hourglasssvg, format: "svg", height: 4mm), baseline: 0.5mm) *#waittime*])
|
data.push([#box(image.decode(hourglasssvg, format: "svg", height: 4mm), baseline: 0.5mm) *#waittime*])
|
||||||
data.push(l)
|
data.push(l)
|
||||||
}
|
}
|
||||||
let _ = data.pop()
|
if (data.len() > 0) {
|
||||||
|
let _ = data.pop() // remove last separator
|
||||||
|
|
||||||
grid(
|
grid(
|
||||||
columns: data.len(),
|
columns: data.len(),
|
||||||
@@ -62,6 +68,8 @@ align(center, {
|
|||||||
gutter: 3.5mm,
|
gutter: 3.5mm,
|
||||||
..data
|
..data
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
v(0.5cm)
|
v(0.5cm)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user