22 releases

new 0.10.0 Jan 14, 2025
0.9.2 Dec 20, 2024
0.9.1 Apr 18, 2024
0.8.5 Feb 27, 2024
0.4.2 Jul 23, 2023

#133 in Parser implementations

Download history 6/week @ 2024-09-24 1/week @ 2024-10-01 3/week @ 2024-10-08 2/week @ 2024-10-15 2/week @ 2024-10-29 5/week @ 2024-11-05 11/week @ 2024-12-10 121/week @ 2024-12-17 9/week @ 2024-12-24 8/week @ 2024-12-31 5/week @ 2025-01-07

143 downloads per month

MIT license

425KB
7K SLoC

Rust 6K SLoC // 0.0% comments JavaScript 756 SLoC // 0.1% comments Python 84 SLoC // 0.0% comments

Contains (WOFF font, 38KB) ui/assets/fonts/Typey_Italic.woff2, (WOFF font, 34KB) ui/assets/fonts/Typey.woff2

cooklang-chef

A CLI to manage cooklang recipes with extensions.

The parser has been moved to cooklang/cooklang-rs

0.10.x will be the last version of chef published on crates.io.

0.15.x will be the last versions of cooklang-fs, cooklang-to-cooklang cooklang-to-human and cooklang-to-md published on crates.io.

What is cooklang

Cooklang is a markup language for cooking recipes. An in depth explanation can be found in cooklang.org.

An example cooklang recipe:

In a large #bowl mix @flour{450%g}, @yeast{2%tsp}, @salt{2%tsp} and
@warm water{375%ml}.

Cover the dough and leave on counter for ~{2-3%hour}.

Sprinkle work surface with @&flour{10%g} and shape the dough. Sprinkle the top
with some more @&flour{5%g}.

Bake with a preheated #oven at 230ºC for ~{30%min}.

What is cooklang-chef

chef is a CLI to manage, read and convert cooklang recipes.

I wanted a couple more features that cooklang did not have, so I extended the cooklang syntax and semantics a bit.

All regular cooklang files parse as the same recipe, the extensions are a superset of the original cooklang format. Also, the extensions can be turned off, so the parser can be used for regular cooklang if you don't like the extensions. All extensions except the multiline steps are enabled by default[^1].

[^1]: This is done to maximize compatibility with other cooklang parsers.

You can see a detailed list of all extensions explained in the parser repo.

Full user documentation here.

You can install chef with:

cargo install --git https://github.com/Zheoni/cooklang-chef/ --tag "v0.10.0" --locked

You can also get a prebuilt binary from the github releases.

After installing it, run:

chef config --setup

Key features:

  • Web UI. The CLI comes with an embedded web UI.

    • Scale and convert the quantities.
    • Hot reload of recipes. Just edit the .cook file and save.
    • Open the .cook file in a code editor.

  • Ingredient references. You can now refer to ingredients you already used before. I think the most important extension to the original cooklang. You can read about using references in this document.

  • Good error reporting. Error reports are a top priority.

    This little recipe contain errors:

    >> servings: 3|6|8
    
    Add @water{1%kg}, mix, and ~{5 min} later add more @&water{1|2%L}.
    

  • Units. An ingredient quantity means nothing without a unit. This is why the units are parsed and checked. With units come:

    • Unit conversion. You can read your recipe in your prefered unit system.
    • Configurable units. You can add, remove and rename units.

Crates

Dependencies

~17–32MB
~547K SLoC