Coder Social home page Coder Social logo

bbstilson / cooklang-chef Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zheoni/cooklang-chef

0.0 0.0 0.0 847 KB

A CLI to manage cooklang recipes

License: MIT License

JavaScript 0.44% Rust 64.21% TypeScript 9.76% CSS 0.48% HTML 0.46% Svelte 24.65%

cooklang-chef's Introduction

cooklang-chef

A CLI to manage cooklang recipes with extensions.

The parser has been moved to cooklang/cooklang-rs

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 default1.

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

Full user documentation here.

You can install chef with2:

cargo install cooklang-chef

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

Footnotes

  1. This is done to maximize compatibility with other cooklang parsers.

  2. This method currently has a problem. A dependency has a bug which is solved but pending a release. Until then error colors won't work. If that is a big problem for you, manually cloning the repo and compiling will work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.