recipe "description" markdown field
This commit is contained in:
parent
238319b9e1
commit
072aa03a53
3 changed files with 9 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue