zheoni / cooklang-chef Goto Github PK
View Code? Open in Web Editor NEWA CLI to manage cooklang recipes
License: MIT License
A CLI to manage cooklang recipes
License: MIT License
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
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.
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.
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.
All other keys work, but "s" just doesn't show if inputted (probably has to do with it being a hotkey for focusing at the search field).
When the $EDITOR
environment variable is set, the "Open in editor" button in the web UI does not use the specified editor.
Line 47 in 0cf2a18
I believe v.is_empty()
should be !v.is_empty()
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?
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
anstream
colorchoice
, colorchoice-clap
, and your choice of environment detection crates including anstyle-query
and supports-color
.We welcome feedback on this topic at rust-cli/concolor#47
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
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?
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.)
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.
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.
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.
it'd be extremely convenient if there were checkboxes to tick next to steps so that, while cooking, you could mark things off! 😅
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.
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.
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).
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!
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.
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.
It may be more commonly expected behavior that on search with empty string
With current behavior, if it happens accidentally, the user may be bewildered or misinterpreting why no recipes are shown (e.g. assuming a bug).
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!
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!
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.
There are different levels of licencing when dealing with cooklang recipes:
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 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.
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.
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.
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.