Quick Start
Let's start writing recipes. First, create the directory structure that will hold all our input data.
- myrecipes/
- recipes/
- pancakes.yaml
Now when we have the structure created, let's create the most minimal possible pancakes.yaml
:
🗎 myrecipes/recipes/pancakes.yaml:
- title: Pancakes
And render it by running:
$ comfyrecipes build myrecipes
This will create a new directory out/
in myrecipes/
containing the built data.
- myrecipes/
- out/
- html/
- index.html
- pancakes.html
- recipes/
- pancakes.yaml
We can see the result if we start a web server pointing to that directory, for example by using:
$ comfyrecipes serve myrecipes
and navigate to http://127.0.0.1:8000/
serve
should NOT be used in production.
While that was a valid recipe, it's not very useful and we can only see the title. Let's improve that:
🗎 myrecipes/recipes/pancakes.yaml:
- title: Pancakes
ingredients:
- 100 gram flour
steps:
- make pancakes
- each ingredient is a step in the format
amount unit name
amount
has to be a numberunit
has to be a single wordname
can be a string with arbitrary content- for a full description of this format, please see the Reference section
- each step is a string with arbitrary content
And again, build, make sure the server is running and navigate to http://127.0.0.1:8000/. From now on, we will assume you know how to build and serve your output directory.
Once more, let's improve the recipe once again to something that can actually be made and is not just a demo. This does not introduce any new concepts compared to the last recipe we wrote.
🗎 myrecipes/recipes/pancakes.yaml:
title: Swedish Pancakes
ingredients:
- 3 piece egg
- 1.25 cup milk
- 0.75 cup all purpose flour
- 1 tablespoon white sugar
- 1 tablespoon butter
steps:
- Beat eggs in a bowl until the mixture is smooth.
- Add milk
- Mix flour, sugar and salt in a separate bowl
- Mix together with the egg mixture, mix until it's smooth
- heat a griddle
- Drop just enough of the mixture to the griddle to spread to all corners
- After about a minute, turn the pancake over
For a full reference for what a recipe yaml can contain, please see the Recipe Reference