@tmlmt/cooklang-parser / Metadata
Interface: Metadata
Represents the metadata of a recipe.
Indexable
[key: string]: MetadataValue
Index signature for additional metadata fields not explicitly typed. Any metadata key in the frontmatter will be captured here.
Properties
author?
optionalauthor:string
The author of the recipe (separate from source author).
category?
optionalcategory:string
The category of the recipe.
course?
optionalcourse:string
The course of the recipe.
cuisine?
optionalcuisine:string
The cuisine of the recipe.
description?
optionaldescription:string
The description of the recipe.
diet?
optionaldiet:string
The diet of the recipe.
difficulty?
optionaldifficulty:string
The difficulty of the recipe.
image?
optionalimage:string
The primary image of the recipe.
images?
optionalimages:string[]
The images of the recipe.
introduction?
optionalintroduction:string
The introduction of the recipe.
locale?
optionallocale:string
The locale of the recipe.
serves?
optionalserves:string|number
The number of people the recipe serves. Should be either a number or a string which starts with a number (which will be used for scaling) followed by a comma and then whatever you want.
Interchangeable with servings or yield. If multiple ones are defined, the prevailance order for the number which will used for scaling is servings > yield > serves. See servings for examples.
servings?
optionalservings:string|number
The number of servings the recipe makes. Should be either a number or a string which starts with a number (which will be used for scaling) followed by a comma and then whatever you want.
Interchangeable with yield or serves. If multiple ones are defined, the prevailance order for the number which will used for scaling is servings > yield > serves.
Examples
servings: 4servings: 2, a fewsource?
optionalsource:string|MetadataSource
The source of the recipe. Can be a simple URL string or structured attribution. When parsed from YAML, source.name, source.url, source.author keys are merged here.
tags?
optionaltags:string[]
The tags of the recipe.
time?
optionaltime:MetadataTime
Time information for the recipe. When parsed from YAML, prep time, time.prep, cook time, time.cook, time required, time, duration keys are merged here.
title?
optionaltitle:string
The title of the recipe.
unitSystem?
optionalunitSystem:string
The unit system used in the recipe for ambiguous units like tsp, tbsp, cup. See Unit Conversion Guide for more information. This stores the original value as written by the user.
yield?
optionalyield:string|number
The yield of the recipe. Should be either a number or a string which starts with a number (which will be used for scaling) followed by a comma and then whatever you want.
Interchangeable with servings or serves. If multiple ones are defined, the prevailance order for the number which will used for scaling is servings > yield > serves. See servings for examples.