💾 Archived View for thorjhanson.com › projects › 20190924-recipes.gmi captured on 2022-06-11 at 20:49:23. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2020-11-07)

-=-=-=-=-=-=-

Recipe Card Generator

Last Update: 9/24/2019

This summer was my second summer spent living not-at-home and without a meal plan, which meant a quite a bit of time spent cooking for myself. Over the last two years, I have started to amass a fair number of recipes in the form of screenshots and images. I thought it would be nice to store these recipes in an organized, consistent format.

My first thought was using Pandoc (a document format converter) and Markdown to generate recipe cards as PDFs. Pandoc has an option to use the Latex PDF engine and take in a Latex template. This technique was almost effective, but I ran into difficulties trying to create a Latex template that would put my bulleted ingredient list into two columns. It was at this point that I recognized what I needed to do: I needed to write the cards in pure Latex.

Pandoc

Latex

I reworked the template with a pure-Latex technique in mind, using a template I found on Github (I have unfortunately been unable to find the original source - if anyone knows, please email me about it). I then set up a small script that will iterate through a series of folders, each with a [recipename].latex file, and generate matching PDFs. At the time, I was not aware of Latex's ability to "include" template files. Consequently, my script concatenates the .latex on the end of the template before processing. This is somewhat tacky, and I may clean this up some point in the future.

The result is something like this:

Chocolate Chip Cookie recipe card [IMG]

I placed the resulting script and the recipes on my Gitlab instance, where I then set up a pipeline that would automatically generate and archive the PDFs after every commit. Generated PDFs can be downloaded by clicking the little cloud button below the blue "Clone" button. You can also download using this link: Zip file of PDFs

my Gitlab instance

Zip file of PDFs

<p style="font-size: 0.75em;"><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0; height:20px; width: auto; display: inline-block;"src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />Image files on this page are licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p>