From ed8c8d64eaa384ad6e03d2877901784efb205112 Mon Sep 17 00:00:00 2001 From: dozens Date: Fri, 2 Feb 2024 13:39:32 -0700 Subject: [PATCH] inits commits --- LICENSE | 11 +++++ README.md | 109 +++++++++++++++++++++++++++++++++++++++++ db/menu.rec | 103 ++++++++++++++++++++++++++++++++++++++ db/recipes.rec | 103 ++++++++++++++++++++++++++++++++++++++ dist/2024-01-29-02.pdf | Bin 0 -> 11933 bytes dist/2024-02-05-09.pdf | Bin 0 -> 12008 bytes dist/menu.rem | 42 ++++++++++++++++ justfile | 100 +++++++++++++++++++++++++++++++++++++ 8 files changed, 468 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 db/menu.rec create mode 100644 db/recipes.rec create mode 100644 dist/2024-01-29-02.pdf create mode 100644 dist/2024-02-05-09.pdf create mode 100644 dist/menu.rem create mode 100644 justfile diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dd3b61 --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +this work is licensed under the TILDE ZINE LICENSE, version 7. + +it may be freely remixed, cut up, pounded into dust, or simply used as +a handkerchief, provided the following conditions are met: + +1. You submit to the next available issue of the TILDE ZINE. +2. You get up right now and do a little dance. +3. You promise to love yourself every day. Sometimes it's hard but + that's why we promise. + +<3 dozens diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce0c1d9 --- /dev/null +++ b/README.md @@ -0,0 +1,109 @@ +# MEALS + +This is my own personal recipe database and meal planner + +STATUS: janky, proof of concept, unsafe, used in production + +## ABOUT + +recipes.rec contains two types: meals and recipes + +a meal may contain many recipe components. + +``` +%rec: meal +%doc: a meal can consist of several recipes +%key: name +%type: recipe rec recipe +%type: name line +%mandatory: name recipe +%allowed: name recipe +``` + +Example: + +``` +name: Lemon Couscous w Salmon and roast broccoli +recipe: lemon couscous +recipe: frozen salmon patties +recipe: roast brocolli +``` + + +and a recipe comprises several ingredients and steps. + +``` +%rec: recipe +%doc: a recipe for one thing +%key: name +%type: name,ingredient,step line +%mandatory: name ingredient step +%allowed: name ingredient step +``` + +Example: + +``` +name: lemon couscous +ingredient: couscous +ingredient: veggie stock +ingredient: lemon juice +ingredient: garlic +step: cook the couscous in the stock +step: drain +step: add lemon and garlic +``` + +menu.rec +contains meals for breakfast, lunch, and dinner for each day. + +``` +%rec: menu +%doc: a menu of meals +%type: breakfast rec meal +%type: lunch rec meal +%type: dinner rec meal +%type: day line +%type: date date +%allowed: day date breakfast lunch dinner +%mandatory: day date breakfast lunch dinner +``` + +Example: + +``` +day: Wednesday +date: 2024-02-07 +breakfast: eggs n peanutbutter +lunch: chipotle bowl +dinner: Lemon Couscous w Salmon and roast broccoli +``` + +the justfile contains scrips for creating a `.rem` file for remind(1). +(from there you can use the `rem2ics` utility to create a calendar file, +or `rem2ps` to create a pdf.) +it also can create a simple pdf menu via groff and tbl. +finally it print a list of ingredients needed for next week's menu +so you can plan your shoping. + +## YOU WILL NEED + +- recutils +- groff +- zx + +## GETTING STARTED + +- add recipes and meals to db/recipes.rec +- plan your weekly menu in db/menu.rec +- `just menu` to create `.rem` and `.pdf` menus for the week +- `just shopping` to print a shopping list + +## TODO + +This might eventually become part of the backend for supervegan.neocities.org + +- [ ] remove zx dep (i thought it would make dates easier in the beginning) +- [ ] parameterize the date for which the week should be calculated. +- [ ] quantity for recipe ingredient? +- [ ] yield for recipe? diff --git a/db/menu.rec b/db/menu.rec new file mode 100644 index 0000000..cbd5498 --- /dev/null +++ b/db/menu.rec @@ -0,0 +1,103 @@ +%rec: menu +%doc: a menu of meals +%type: breakfast rec meal +%type: lunch rec meal +%type: dinner rec meal +%type: day line +%type: date date +%allowed: day date breakfast lunch dinner +%mandatory: day date breakfast lunch dinner + +# WEEK 05 / 52 + +day: Monday +date: 2024-02-05 +breakfast: eggs n peanutbutter +lunch: chipotle bowl +dinner: stirfry w roast brocolli + +day: Tuesday +date: 2024-02-06 +breakfast: eggs n peanutbutter +lunch: chipotle bowl +dinner: pasta with balls and roast broccoli + +day: Wednesday +date: 2024-02-07 +breakfast: eggs n peanutbutter +lunch: chipotle bowl +dinner: Lemon Couscous w Salmon and roast broccoli + +day: Thursday +date: 2024-02-08 +breakfast: eggs n peanutbutter +lunch: chipotle bowl +dinner: Roast squash w mashed potatoes + +day: Friday +date: 2024-02-09 +breakfast: eggs n peanutbutter +lunch: chipotle bowl +dinner: Burgers + + +# WEEK 04 / 52 + +day: Monday +date: 2024-01-29 +breakfast: eggs n cornbread +lunch: 3P Pasta +dinner: stirfry w roast brocolli + +day: Tuesday +date: 2024-01-30 +breakfast: eggs n cornbread +lunch: 3P Pasta +dinner: Corndogs n fries + +day: Wednesday +date: 2024-01-31 +breakfast: eggs n cornbread +lunch: 3P Pasta +dinner: Black bean grain bowl + +day: Thursday +date: 2024-02-01 +breakfast: eggs n cornbread +lunch: 3P Pasta +#dinner: Roast squash w mashed potatoes +dinner: canceled + +day: Friday +date: 2024-02-02 +breakfast: eggs n cornbread +lunch: 3P Pasta +dinner: FFY + + + +# WEEK 02/52 + +day: Monday +date: 2024-01-15 +breakfast: eggs n cornbread +lunch: Chili +dinner: gnocci and squash + +day: Tuesday +date: 2024-01-16 +breakfast: eggs n cornbread +lunch: Chili +dinner: mashed potatoes w mac-n-cheese + +day: Wednesday +date: 2024-01-17 +breakfast: eggs n cornbread +lunch: Chili +dinner: stirfry w roast brocolli + +day: Thursday +date: 2024-01-18 +breakfast: eggs n cornbread +lunch: Chili +dinner: spaghetti n balls diff --git a/db/recipes.rec b/db/recipes.rec new file mode 100644 index 0000000..2d2bf91 --- /dev/null +++ b/db/recipes.rec @@ -0,0 +1,103 @@ +%rec: meal +%doc: a meal can consist of several recipes +%key: name +%type: recipe rec recipe +%type: name line +%mandatory: name recipe +%allowed: name recipe + +name: chipotle bowl +recipe: chipotle bowl + +name: stirfry w roast brocolli +recipe: stirfry +recipe: roast brocolli + +name: pasta with balls and roast broccoli +recipe: pasta +recipe: gardein frozen balls +recipe: roast brocolli + +name: Lemon Couscous w Salmon and roast broccoli +recipe: lemon couscous +recipe: frozen salmon patties +recipe: roast brocolli + +name: Roast squash w mashed potatoes +recipe: frozen roast squash +recipe: mashed potatoes + +name: Burgers +recipe: beyond burger cookout classic + +%rec: recipe +%doc: a recipe for one thing +%key: name +%type: name,ingredient,step line +%mandatory: name ingredient step +%allowed: name ingredient step + +name: chipotle bowl +ingredient: black beans +ingredient: brown rice or farro +ingredient: yellow onions +ingredient: corn +ingredient: peppers +step: cook the beans +step: cook the rice +step: saute the onions and peppers +step: combine everything and spice it up + +name: mashed potatoes +ingredient: russet potato +ingredient: butter +ingredient: milk +step: boil water +step: add potatoes (do not peel) +step: boil until soft enough to pass a knife though + +name: lemon couscous +ingredient: couscous +ingredient: veggie stock +ingredient: lemon juice +ingredient: garlic +step: cook the couscous in the stock +step: drain +step: add lemon and garlic + +name: beyond burger cookout classic +ingredient: beyond burgers +ingredient: burger buns +ingredient: ketchup and mustard +ingredient: red onion +ingredient: sliced tomato +step: air fry at 365 for 30 minutes + +name: frozen roast squash +ingredient: frozen squash +step: cook it in the air frier + +name: frozen salmon patties +ingredient: frozen salmon patty +step: fry it in the pan + +name: pasta +ingredient: spaghetti or other pasta +ingredient: pasta sauce +step: boil the pasta +step: heat up the sauce in a sauce pan + +name: gardein frozen balls +ingredient: frozen balls +step: heat them up in the microwave + +name: stirfry +ingredient: frozen stirfry +step: heat it up in a pan + +name: roast brocolli +ingredient: brocolli +step: preheat the oven to 350 +step: tear the brocolli into bite sized pieces +step: add drizzle of oil and dash of seasond salt +step: bake for 30 minutes diff --git a/dist/2024-01-29-02.pdf b/dist/2024-01-29-02.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ebaeb0e96733c1b22bebbf3851f855c42af34e80 GIT binary patch literal 11933 zcmeHN3vd-lKeu8OGegrPminrX0We#oON4^5&AgmuKAvo_Xwu+_{gM+xnNTz2{;3 zrWaZtKj!qC=1*O8>zYL$oVsHCg8gq>FuY{vzAxT=`S#zJl#bePMSgVgyOsN_KR8j- zSF^YEm7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`btq~ zdUi?)pzLE3fBq(Zw z*3$FcNKZbd^a1Hb@0?cTQ5m#Q=|I|1p6Y_6r<$=K=}Bb+Nl&ya{_UhEX`yCiaQb~n z&%u4wJL#qJgH!H5ngN=PuX%n5(v$m2`ce6HaLT7M$a?b4MD097w5P|ue6P$9?Kwny zf}|b1z!~^OH$;098?QbShiFgEsd{YL5bepyLh&()WTyXFhc9wrdEb-7CJ)h`L}v!w zBtAE>PiqQKpkTZDR z+Ys+5Iiw-p(5*)}Zcd-y&bd&#BA|8*$S(>S`GNg=n9m~nGNF-K)deJ|x4D%6Gdr(;< ziob;pDyyhK=L{^v+ooUXTZ%U{2e(UviMkrtHxVOJYG4^&azpZSU|B^1DX~Fi;qq9( zHoTr?n7SRRtPDXzE^RS>QI>9&Hd}Zlg43xO97dl`9^)6g@$v!pVI&f-h=z)b>ze9A F{{fB6M4tcv literal 0 HcmV?d00001 diff --git a/dist/2024-02-05-09.pdf b/dist/2024-02-05-09.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ac633b893c946b65339de8b4b2a8fd0771ded09 GIT binary patch literal 12008 zcmeHN4UiPowN6q9$!Po|c~UBPDO~{#d***;&8lzNorM)-VPU})G4{;#%rx6GJ@m}% z50pQTpe80!#04~aefsw{N_-+ZSSfW+msb+FAznR-vpH$|W`@ zjHNA%&Go@V+o}{r?F?Yra>A55csnFXo04`y~3 zb%teGohtQ08prXGWHnx+VU~59L8Gaa^#(mQyS+x|a8Kt=iJM zqp)(?srwIXyt8WgkN15%^cTj;%clQw(sz3jdrsK)bjS8{Umx9b-L<{fj5=fG1K-;5 zm9?)we^;pU*1J0Uo_PP2{p)&)n|lv0^RHhs`lMfUT|4Hz;#o^ZjhkD)Y-8Ptw*|Mc zNzc9c?L%Mg?LA}huwAe3ysJj zhu*p4qS_+|uiBLv_u{(s8}=?6@#wqBwC@L}{Cf3&`q%aiy=lpT8_(CD?pf77^tR1Tin^z81YZ&htAuD|%egcnldZXb2uJ$wIS-l)mn&wOQK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un8 zcAT@|f-$Kf$Cg~Y`l01B=bsasoqu=a(uYs`)uVU6TysP$_Tz1Zi*3u6* zWgpGA`8Q@pKJex#m!xOyy0q`YMMpou;}Wr?TsV;OY_afY=3zXM&-rZ16G;})=%2!Q zMv&QsDioJT_ng(w~3JOlU;t@1_wD-JX4clpb|$9YDgNdF*pMHJK*cHH9`R>WWidNE6XJ)e&W+>c|(o9Q!K2s5&C}RG#{Ay^+3B6dL)8 z@?JVh(Na`Sd3qe(WuEw8Ri{!e6ZN9Ds*J`~c^V^3yfn(7l-i5GszvA@ah{w6MQzYp zdOjcN$;XsFAie0F(~3MQy%s7RNIS|?otN}fGv*~dsjNTgiIzn^oAe|t)T|6lzX<6$ zu&;V2y;Oc+%Kb+(K(p~F&p(6o98+fC^JZV4$__= zX$L28`hU?4(w@Y|tIxzi+LLpt4qG-zdvdZ+d`u#l>3-JXi(FXF_aw2&gS02nnO--E z&rK{;-<$ZO#lMpF{TL=20#$9y>w%bMh2@%mK_@kl|^rA05{6%@K(L|33mZIKBfi^F@P zEfGevAYN`n(iHIiWQu+-oCA218kt+Y3xB6?%Hy3+ylui$ymG?RCULC^TJX*S{`T(h zxBPynhqmpq^^6b6yO0kry2*cd0Xh^zbqUIeWENHK&o&+yJ$FsL}&lLu?XIn8&Fmgt@(s5{u;kW zXS|+en7Zw&t@S}uA!9LqQI>9&wpe&2g43xO9L55jJjQ8kynMiY7ziMJ dist/menu.rem + recsel db/menu.rec | recfmt {{remtmpl}} + +# build menu pdf from menu.rec +pdf: + #!/usr/bin/env zx + const curr = new Date() + const firstday = new Date(curr.setDate(curr.getDate() - curr.getDay())); + const lastday = new Date(curr.setDate(curr.getDate() - curr.getDay()+6)); + const options = { + year: "numeric", + month: "long", + day: "numeric", + }; + const rec = await $`recsel db/menu.rec -e ${'date >> "' + firstday + '"'}`.quiet() + .pipe($`recsel -e ${'date << "' + lastday + '"'}`).quiet() + const bkfst = await $`echo ${rec}`.quiet() + .pipe($`recsel -p breakfast`).quiet() + .pipe($`recfmt '.ad l + {{{{breakfast}} + T};T{ + '`).quiet() + const lunch = await $`echo ${rec}`.quiet() + .pipe($`recsel -p lunch`).quiet() + .pipe($`recfmt '.ad l + {{{{lunch}} + T};T{ + '`).quiet() + const dinner = await $`echo ${rec}`.quiet() + .pipe($`recsel -p dinner`).quiet() + .pipe($`recfmt '.ad l + {{{{dinner}} + T};T{ + '`).quiet() + const firstdaygroff = new Date(firstday.setDate(firstday.getDate()+1 - firstday.getDay())).toLocaleString('en-US', options); + const lastdaygroff = new Date(lastday.setDate(lastday.getDate() - lastday.getDay()+5)).toLocaleString('en-US', options); + const tmpl=` + .ce + .I + chez brun + .sp 2 + .LP + .ps 14 + ${firstdaygroff} - ${lastdaygroff} + .ps + .sp 3 + .LP + .TS + center expand tab(;); + l | lp+2 lp+2 lp+2 lp+2 lp+2 + - | - - - - - + l | l l l l l. + ;Monday;Tuesday;Wednesday;Thursday;Friday + Breakfast;T{ + ${bkfst} + T} + .sp + Lunch;T{ + ${lunch} + T} + .sp + Dinner;T{ + ${dinner} + T} + .TE` + await $`echo ${tmpl}`.quiet() + .pipe($`groff -t -ms -Tpdf -d paper=letterl -P-pletterl > dist/${new Date(firstdaygroff).toISOString().slice(0, 10)}-${new Date(lastdaygroff).toISOString().slice(8,10)}.pdf`) + +# build menus! +menu: rem pdf + +# shopping list +shopping: + #!/usr/bin/env sh + begin=$(gdate -d'next sun') + end=$(gdate -d'next sun +7 days') + recsel db/menu.rec -e "date >> '$begin'" \ + | recsel -e "date << '$end'" -P breakfast,lunch,dinner -C \ + | sort \ + | uniq \ + | xargs -I % recsel db/recipes.rec \ + -t meal \ + -j recipe \ + -e "name = '%'" \ + -G name \ + -P recipe_ingredient \ + | sort