diff --git a/comfyrecipes/parsing.py b/comfyrecipes/parsing.py index da2327b..49f6e9f 100644 --- a/comfyrecipes/parsing.py +++ b/comfyrecipes/parsing.py @@ -254,6 +254,7 @@ class Recipe(Element): self, ctx: Context, title: str, + description: Optional[SafeHTML], source: Optional[SafeHTML], ingredients: List[IngredientInstance], subrecipes: List["Recipe"], @@ -264,6 +265,7 @@ class Recipe(Element): self.srcpath = "" self.outpath = "" self.title = title + self.description = description self.ingredients = ingredients self.subrecipes = subrecipes self.price = price @@ -328,9 +330,14 @@ class Recipe(Element): if "source" in dct: source = SafeHTML.from_markdown(dct["source"]) + description = None + if "description" in dct: + description = SafeHTML.from_markdown(dct["description"]) + return cls( ctx=ctx, title=dct["title"], + description=description, source=source, ingredients=ingredients, subrecipes=subrecipes, diff --git a/comfyrecipes/schemas/recipe.json b/comfyrecipes/schemas/recipe.json index e2220b0..0ca33bd 100644 --- a/comfyrecipes/schemas/recipe.json +++ b/comfyrecipes/schemas/recipe.json @@ -8,6 +8,7 @@ "additionalProperties": false, "properties": { "title": { "type": "string" }, + "description": { "type": "string" }, "source": { "type": "string" }, "ingredients": { "type": "array", diff --git a/comfyrecipes/templates/recipe.html b/comfyrecipes/templates/recipe.html index 0b1bde7..d7824cb 100644 --- a/comfyrecipes/templates/recipe.html +++ b/comfyrecipes/templates/recipe.html @@ -17,6 +17,7 @@ {{getrecipe(subrecipe)}} {% endfor %}
{{rec.description.html|safe}}
{%endif%} {% if rec.source != None %}source: {{rec.source.html|safe}}{%endif%} {% if rec.ingredients|length != 0 %}