Comment by insonable

Comment by insonable 4 days ago

9 replies

There's a lot you can do with just plain html these days if you just need a clean site. Here's an example from my recipe site (https://xilic.com/recipia/sauces/pesto_traditional.html), mostly for my personal use or sharing with friends, with only html/css. It has expandable boxes, a menu system, etc. A simple script converts a directory structure of .csv files to these recipe cards with a template, and this way you can edit the sources in a spreadsheet and then the publish script just takes whatever is new and re-does the whole lot of html as necessary. Just like we used to do with Apache Forest!

nayuki 4 days ago

Really appreciate that you're doing mass-based recipes, and in metric too. I'm tired of all the American recipes with quantities like "2 1/3 cups"; the proliferation of units and fractions makes work needlessly hard compared to just grams and millilitres.

  • 0xEF 4 days ago

    Furthermore, when it comes to recipes for baking, if it's not using weight as a measure, then it's wrong. Baking is chemistry, so if you want consistent controlled results, stop measuring anything by volume.

    Sorry, pet peeve of mine as a hobby baker.

  • insonable 3 days ago

    it's also just way faster to not mess with the spoons/cups! an exception might be little fussy quantities like a bunch of 1/4 tsps of different spices etc.

makizar 4 days ago

What a beautiful website ! Feels carefully crafted, full of nice moments like the > turning the a - when sections are open in the TOC. Would love to hear more detail on how you went about making it. Did you ever consider sharing parts of the source code ?

  • insonable 3 days ago

    thanks! i first just made a sample html the way i thought it would be nice, then made that into a templeate, and wrote a python script generate the site. it first scans for all the files to build the menu and homepage, then goes file-by-file to make each one, filling in the blanks in the template as you can imagine. it was pretty natural since my spreadsheets were all following the same format already anyway. i'd be surprised if there was a lot of interest, but if so i'd consider sharing the script/template etc.

HumblyTossed 4 days ago

what's the csv look like?

  • insonable 3 days ago

    simple like:

    title

    subtitle

    .. [two blank lines make a section break]

    ingredients with 4 columns, last one is an optional comment for the row

    ..

    method steps with 2 columns, last one is optional comment

    ..

    then optional sections that just have to have:

    section title (this is the collapsed title string too)

    any rows included until the next .. etc. etc.

    plus just a few tricks like if an ingredient comment has [] then it uses that as a URL for the ingredient, if a row in ingredients has just one column then it's a header etc.