Coder Social home page Coder Social logo

cooklang-chef's People

Contributors

someone0nearth avatar stardylan avatar zheoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cooklang-chef's Issues

Remove timer name in recipe instructions

Issue

Currently, when we create a recipe with a named timer, it displays the name and duration together. For example, from the Cooklang spec:

Boil @eggs{2} for ~eggs{3%minutes}.

This is currently rendered as:

Boil eggs for eggs 3 minutes 

Proposal

I think it would read better and make more sense to remove the timer name in the steps, and instead have it say:

Boil eggs for 3 minutes

Of course the name would still be shown when the timer is started to identify which timer it is.

Let me know your thoughts, and I'd be happy to open a PR if this sounds good.

Step counter begins at n+1 in define ingredients mode

Testing with an example file:

>> time: 3
>> description: Cook water (ingredients list)
>> [define]: ingredients
- @water{1%l}
- @more water{2%l}
- @even more water{2%l}

>> [define]: steps
Put water into a cooker
Press the button
Wait till it boils

Getting:

chef recipe test/water-def.cook                                                                                                                                                                                                                                                            ✔ 
 water-def 

│ Cook water (ingredients list)

time: 3m

Ingredients:
  water               1 l 
  more water          2 l 
  even more water     2 l 

Steps:
 4. Put water into a cooker
     [-]
 5. Press the button
     [-]
 6. Wait till it boils
     [-]

Concerns both WebUI and CLI versions.

Use cooklang as a library

Hi there. I love the project, but I would like to interact with a few components as a library so that I can create a more automated experience.

Specifically, what I'm trying to do is get access to the combined ingredients given a list of recipes so that I can programmatically update my grocery list.

It doesn't seem like this is directly possible, but I am somewhat new to Rust, so I might be missing something. If it is not possible, I'm happy to tackle abstracting this as a PR if that's inline with what you have in mind for the future of the project.

shopping-list creation in the ui?

the ui you've made is really lovely; super functional and great.

it would be a dream if it was possible to have a little feature to build a shopping-list from the website

i could imagine it working a bit like a typical shopping-cart; you pick the recipes you want to build the list for, and then you get to see the aggregated items to buy.

thoughts?

Potential deprecation of `concolor`

I'm posting this as this project is reported as a dependent of concolor and wanted to both give you a heads up to prepare and an opportunity to discuss in case we should re-evaluate this.

We are proposing deprecating concolor in favor of either

We welcome feedback on this topic at rust-cli/concolor#47

i18n for cooklang-to-XY

Hello!

My plans are to write recipes in English and German and export them to MD. But the section names are hard-coded in Englisch.

I used for a quick prototyping https://github.com/longbridgeapp/rust-i18n in cooklang-to-md to reuse the localization files of "./ui/i18n" and it worked out of the box.

What are your thoughts about this? Would this be a proper solution for you?

Have fun,
someone.earth

would be great to re-reference "items" as well as ingredients

thanks so much for putting this together :)

i see you decided to have a syntax to support re-referencing ingedients (awesome!) it would be great if this could be extended to items as well, such as:

Prepare a  #mixing  bowl{} ...

... put veggies in the #&mixing  bowl{}.

thoughts?

Timer in a different language

Is there a possibility to show timer units in a non-English language? If yes, which syntax has to be used?

(Using timer name still shows "minutes" in English.)

Ingredient quantity's decimal place flickering

Issue Description

I noticed that the ingredient quantities briefly show their decimal places before reverting to whole numbers, especially when changing the servings. This behavior causes a noticeable flicker in the UI.

Steps to Reproduce

  1. Open a recipe with ingredient quantities that include decimal places.
  2. Change the number of servings.
  3. Observe the quantities momentarily displaying decimals before switching to whole numbers.

Root Cause

It appears that the HTML sent to the browser initially includes the decimals. However, a JavaScript script then modifies these values to whole numbers, causing the flickering effect.

Proposed Solution

To prevent this flickering, I propose that we handle the formatting on the server side using minijinja. We can remove the decimal places for whole numbers before sending the HTML to the client and thus eliminate the need to format the numbers client-side.

If this solution sounds good, I'd be happy to open a PR to implement this change.

checkboxes on steps

it'd be extremely convenient if there were checkboxes to tick next to steps so that, while cooking, you could mark things off! 😅

Unable to view recipe if using full path.

Debian Sid, cooklang-chef 0.8.3

A somewhat recent change made it so you can't use the full path to view a recipe. Using chef recipe works, but chef recipe does not. It produced Error: Recipe not found.

Scaling does not work

Testing with a sample water.cook file:

>> time: 3
>> description: Cook water

Put @water{1000%ml} into a #cooker
Press the button
Wait till it boils

Getting message "This value does not scale" this when trying to scale:

image

Changing serve port

Is it possible to change the port for the serve command? I would love to run this on my server, but the 8080 port is already used.
I did briefly go through the code but I couldn't find anything related to 8080 or to a port configuration setting.

Add arbitrary metadata

Seems currently only time, source, author and description are supported. Specification seems not to limit this, according to examples. Would be nice to have arbitrary metadata keys (especially useful for languages other than English).

Can I help with german translation as a noob?

Hello!

I really like your project! But as I can't code in a way that helps you, I was thinking if I maybe can help with german translation.

Is this a realistic thought?

Thank you very much!

Add a "clear" button / element for search field

Would be especially helpful for clearing tags.

Maybe it would be nice to enhance the search field even further (like adding filters as UI elements etc.), but this would be a separate request.

Don't index recipes outside a collection

When chef is run outside a collection, a warning should be shown.

The chef serve and chef list subcommands shouldn't be allowed outside a collection. Maybe add a flag to force it.

Searching with empty search string shows "No recipes found"

It may be more commonly expected behavior that on search with empty string

  • either all recipes are shown
  • or the user gets some sort of feedback that his search string is empty.

With current behavior, if it happens accidentally, the user may be bewildered or misinterpreting why no recipes are shown (e.g. assuming a bug).

Fix release CI builds

  • It currently fails for x86 MacOS
  • I would like to add arm64 MacOS, and arm64 linux.

make it work on arm

Hello!

I have a pi zero running in my network and would love to run chef on it. I think there needs to be ARM support for it?

Is there a way to make this possible or would this include a lot of work?

Thank you very much! I'm using chef very often and it's so cool!

Error loading default global config file and rust error

Hello!

With Version 0.8.3-1 i get the following error when running chef list:

Error: Error loading default global config file

Caused by:
    0: Bad TOML data
    1: TOML parse error at line 6, column 1
         |
       6 | [extensions]
         | ^^^^^^^^^^^^
       Unknown extension name

I deleted [extensions] in the configuration file and the list command was functional again.

But when i try chef serve I get the following error and the server wont start:

2024-02-09T22:11:50.984197Z  WARN Config dir `.cooklang` found not in base path. It will be ignored. You may be running the application in the wrong directory.
thread 'main' panicked at /home/jannisf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cooklang-0.13.0/src/parser/block_parser.rs:67:9:
assertion `left == right` failed: Block tokens not parsed. this is a bug
  left: 1
 right: 3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at src/serve/async_index.rs:167:14:
called `Result::unwrap()` on an `Err` value: Error { kind: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" }), paths: ["/home/jannisf/.local/share/Trash/files/home/jannisf/.wine/dosdevices/z:/var/cache/ldconfig"] }

Thank you very much!

Recipes Licencing

I am pondering about how to implement a licencing of the recipes, like licence text, licence url, year and so on (and maybe licence information for the source of a recipe, too). My current focus is not how to deal with a source licence of a recipe, but I mentioning it for completeness.

Some thoughts

There are different levels of licencing when dealing with cooklang recipes:

  • The licence of the source of the recipe
  • The licence of the cook-files
  • The licence of the created artefacts (like using cooklang-to-md)

Licencing with the current possibilities:

Cooklang recipes are self-created (so >you< are the "source")

  • The cook-files are like "normal" source-code and covered by the repo licence

But when creating the artifacts out of the cook-files (e.g. with cooklang-to-md), the created artefacts not really link to the repo licence or a licence at all.

  • The licence is included in the cook-file and will be exported like a normal part of the recipe

The syntax/format etc. of the licence part has to be specific for the target format (like md, human readable etc), so cook-files would contain export specific formatting.

Also, when you want to publish the artefacts with another licence, you would have to change the cook-files for it.

Cooklang recipes are created out of existing recipes (so the source is not >you<)

  • The repo licence is compatible and fulfilling the source licence (but has the same issue when creating the artefacts)
  • The source license information is part of the cook recipe (same issue with being format specific)

My (current) preferred Solution for "source is >you<"

The cook-files are like source-code and be covered by the repo licence.

For the artifacts, an extension for the cooklang-chef cli config for having the possibility to add licence informations, which will be added to the created artefacts.

Using special metadata keys supported by the parser itself would be a possible solution, too, but I think, the licence for the created artefacts should be a configurable thingy.

My (current) thoughts for "source is not >you<"

A source licence directly belongs to the recipe itself, so the information should be part of the cook-files. The author of the cook-files have to ensure, that the repo and artefacts licences are compatible with and fulfilling the source licence.

I think, special metadata keys would be a good place for the source license information (so be part of cooklang-rs), which could be considered when creating artifacts with cooklang-chef.

Summary

  • The licence of the source of the recipe (not my current focus)
  • With special metadata key
  • The licence of the cook-files
  • Repo licence (or licence information as comments within the files itself)
  • The licence of the created artefacts (like using cooklang-to-md)
  • Extend cooklang-chef cli config

What do you think?

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.