Compare commits

...

2 Commits

Author SHA1 Message Date
Joel von der Weid
bf158b0ea1 Add typst recipe template 2024-01-12 15:30:06 +01:00
Joel von der Weid
7d997f5809 Reorganise folders 2024-01-12 15:29:35 +01:00
7 changed files with 95 additions and 0 deletions

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

31
typst/recipe/example.typ Normal file
View File

@ -0,0 +1,31 @@
#import "recipe.typ": template, step
#show: doc => template(
title: "Nom de la recette",
persons: 4,
preptime: "30 min",
cooktime: "2 h",
doc
)
= Pâte
#step([
3 jaunes d'oeufs \
40g de sucre \
1cc de sel
], [
Voila un exemple d'étape avec plusieurs petits ingrédients qui doivent etre utilisé en meme temps.
])
#step([
3 jaunes d'oeufs
], [
Voila un exemple d'étape avec un seul ingrédient.
])
#step([], [Voici une dernière étape à faire sans
aucun ingrédient, genre y garder au
frais.])
#step([Des ingredients seuls \ Genre une liste], [])
= Façonnage
Voila un exemple de section qui ne prend aucun ingrédient mais donne des instructions sur le façonnage ou la cuisson par exemple.

64
typst/recipe/recipe.typ Normal file
View File

@ -0,0 +1,64 @@
#let ovensvg = ```<?xml version="1.0" encoding="utf-8"?><!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon --><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve"><g><g transform="translate(0.000000,511.000000) scale(0.100000,-0.100000)"><path d="M797.8,4946l-72.8-64V110v-4772l72.8-64l70.6-64h4127.5h4127.5l70.6,64l72.8,64l6.6,4710.2c4.4,3293.1,0,4732.2-17.7,4789.6c-13.2,44.1-48.6,101.5-81.7,125.8l-57.4,46.4H4993.7H868.4L797.8,4946z M8814.4,3740.9v-827.7H4995.9H1177.4v827.7v827.7h3818.5h3818.5V3740.9z M8814.4-949.5v-3399.1H4995.9H1177.4v3399.1v3399.1h3818.5h3818.5V-949.5z"/><path d="M2921.1,4195.5c-198.6-64-304.6-189.8-322.3-379.6c-35.3-375.2,421.6-609.2,697.5-359.8c282.5,256,145.7,699.7-231.8,746C3016,4208.8,2952,4206.6,2921.1,4195.5z M3046.9,3760.7c-19.9-19.9-61.8,13.2-46.4,39.7c8.8,13.2,22.1,13.2,37.5-2.2C3051.3,3785,3055.8,3769.5,3046.9,3760.7z"/><path d="M4854.6,4182.3c-176.6-61.8-278.1-211.9-278.1-408.3c0-240.6,174.4-419.4,408.3-419.4c108.2,0,238.4,44.1,304.6,105.9c114.8,103.7,161.1,339.9,94.9,496.6c-55.2,136.9-249.4,260.5-399.5,258.2C4960.6,4213.2,4903.2,4200,4854.6,4182.3z M5018,3774c0-11-8.8-22.1-22.1-22.1c-11,0-22.1,11-22.1,22.1c0,13.2,11,22.1,22.1,22.1C5009.1,3796,5018,3787.2,5018,3774z"/><path d="M6849.9,4191.1c-247.2-75-379.6-368.6-267.1-589.3c86.1-165.5,214.1-247.2,388.5-247.2c178.8,0,311.2,86.1,388.4,253.8C7509.9,3930.7,7194.3,4292.7,6849.9,4191.1z M6984.6,3767.3c-28.7-28.7-57.4-6.6-35.3,26.5c6.6,13.2,24.3,17.7,37.5,11C7000,3796,7000,3782.8,6984.6,3767.3z"/><path d="M2367.1,1613.1c-315.6-101.5-554-377.4-615.8-712.9c-15.5-79.4-22.1-737.2-17.7-1840.8c6.6-1615.7,8.8-1726,48.5-1829.8c94.9-258.3,295.8-467.9,547.4-569.5l117-48.6l2491.9-6.6c2723.7-6.6,2635.4-8.8,2858.3,121.4c216.3,125.8,386.3,366.4,441.4,620.2c30.9,152.3,35.3,3388.1,2.2,3558c-64,339.9-315.6,620.2-637.9,715.1c-108.1,30.9-399.5,35.3-2615.5,33.1C2651.8,1652.8,2481.9,1650.6,2367.1,1613.1z M7468,1191.5c108.1-28.7,240.6-145.7,289.1-251.6c22.1-50.8,41.9-141.3,41.9-205.3v-117H4995.9H2192.7v117c2.2,203.1,121.4,381.9,300.2,445.9c70.6,26.5,505.4,30.9,2491.9,33.1C6481.3,1213.6,7419.4,1204.8,7468,1191.5z M7794.6-1234.2l-6.6-1410.4l-66.2-94.9c-35.3-50.8-110.4-117-163.3-145.7l-97.1-50.8H4995.9H2530.4l-97.1,50.8c-53,28.7-125.8,94.9-163.3,145.7l-66.2,94.9l-6.6,1410.4l-4.4,1410.4h2803.1H7799L7794.6-1234.2z"/></g></g></svg>```.text
#let clocksvg = ```<svg xmlns="http://www.w3.org/2000/svg" height="16" width="12" viewBox="0 0 384 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48h8V67c0 40.3 16 79 44.5 107.5L158.1 256 76.5 337.5C48 366 32 404.7 32 445v19H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H360c13.3 0 24-10.7 24-24s-10.7-24-24-24h-8V445c0-40.3-16-79-44.5-107.5L225.9 256l81.5-81.5C336 146 352 107.3 352 67V48h8c13.3 0 24-10.7 24-24s-10.7-24-24-24H24zM192 289.9l81.5 81.5C293 391 304 417.4 304 445v19H80V445c0-27.6 11-54 30.5-73.5L192 289.9zm0-67.9l-81.5-81.5C91 121 80 94.6 80 67V48H304V67c0 27.6-11 54-30.5 73.5L192 222.1z"/></svg>```.text
#let template(
title: "",
persons: none,
preptime: none,
cooktime: none,
doc
) = {
set page(
paper: "a4",
numbering: "1",
)
set par(justify: true, leading: 0.6em)
set text(
font: "Linux Libertine",
size: 12pt,
)
show heading: set text(font: "Roboto")
v(0.5cm)
align(center, text(35pt, font: "Roboto")[
#text(title, weight: "medium")
])
v(-0.8cm)
align(center, {
let l = [#v(-0.25em)#line(length: 1.5em, angle: 90deg)]
let data = ()
if persons != none or persons != 0 {
data.push([#box([*#persons* pers], baseline: 3.5mm)])
data.push(l)
}
if preptime != none or preptime == "" {
data.push([#box(image.decode(clocksvg, format: "svg", height: 4.5mm), baseline: 1mm) *#preptime*])
data.push(l)
}
if cooktime != none or cooktime == "" {
data.push([#box(image.decode(ovensvg, format: "svg", height: 4.5mm), baseline: 1mm) *#cooktime*])
data.push(l)
}
let _ = data.pop()
grid(
columns: data.len(),
rows: 1,
gutter: 3.5mm,
..data
)
})
v(1cm)
doc
}
#let step(ingredients, procedure) = {
style(styles => {
let space = measure(par(ingredients, leading: 0.8em), styles).height - 0.75em
grid(columns: (1fr, 1fr), par(ingredients, leading: 0.8em), [#v(space)#procedure])
})
v(5mm)
}