食谱风 Markdown
您是否曾经想过一种更简单的方法来编写和维护食谱?您是否厌倦了那些让您难以指定所有美味、神圣文本的配料或说明的应用程序?您是否宁愿自己动手,只用一个纯文本编辑器来编写食谱?
注意:这是一个仍处于起步阶段的业余项目。欢迎提出建议!
隆重推出食谱风 Markdown!只需使用 Markdown,您就可以以一种宽松的、带有偏见的方式编写您的美味食谱,其阅读方式几乎与您祖母(或祖父!)的食谱完全相同。更妙的是,这个包允许您在 Dart 中解析食谱风 Markdown 文档,并以您喜欢的方式使用它们!让我们开始烹饪吧!
下面是肉桂卷食谱在食谱风 Markdown 中的样子。
---
# Use YAML front matter to specify recipe metadata
categories: desserts, baking, feel good, comfort food
yields: 18 cinnamon rolls
servings: 9
prep: 20 mins
cook: 20 mins
---
# Homemade Cinnamon Rolls
Made from scratch, these soft, creamy cinnamon rolls will leave you feeling happy and satisfied, even on the coldest winter nights. Pour over a generous, sugary glaze for the warm, comforting snack you know you deserve!
## Ingredients
### Dough
- 2 cups all-purpose [flour]
- 2 tbsp [white sugar]
- 2 tsp [baking powder]
- 1 tsp [salt]
- 3 tbsp [butter], softened
- 3/4 cup [milk]
- 1 [egg]
### Filling
- 1/2 cup [white sugar]
- 1/2 cup [brown sugar]
- 1 tbsp [ground cinnamon]
### Cream Cheese Frosting
- 1 cup [powdered sugar]
- 4 oz [cream cheese], softened
- 1/4 cup [butter], softened
- 1/2 tsp [vanilla extract]
## Instructions
1. Preheat oven to 400 degrees. Brush a [9" baking dish] with 2 tbsp [butter].
2. Whisk [flour], 2 tbsp [white sugar], [baking powder], and [salt] together in a large bowl.
3. Work 3 tbsp softened [butter] into [flour] mixture using your hands. Beat [milk] and [egg] together in another bowl; pour into flour-butter mixture and stir with a spatula until a soft dough forms.
4. Whisk 1/2 cup [white sugar], [brown sugar], and [cinnamon] together in a small bowl. Sprinkle 1/2 of the cinnamon sugar mixture in the bottom of the prepared baking dish.
Sprinkle remaining cinnamon sugar over butter-brushed dough. Roll dough around filling to form a log; cut log into 18 rolls and place rolls in the prepared baking dish.
5. Bake in the preheated oven until rolls are set, 20 to 25 minutes.
6. Beat [powdered sugar], [cream cheese], 1/4 cup softened [butter], and [vanilla extract] together in a bowl until frosting is smooth. Top hot cinnamon rolls with cream cheese frosting.
## Notes
Don't need as much? Cut the recipe in half and bake for only 15 minutes!
关于
食谱风 Markdown 基于 Dart 的 markdown 包,通过添加语法扩展和链接解析器来构建。
未解析的链接被标记为引用,允许使用此包的开发人员确定链接是否指向配料、烹饪用品,甚至是另一个食谱。烹饪用量将在 Markdown 文档中识别它们出现的任何地方,使用诸如 1 3/4 cups 之类的语法扩展。使用此包的开发人员可以遍历 Markdown 语法树节点,查找 Quantity 和 Reference 节点。例如,出现在同一文本行中的 Quantity 节点出现在 Reference 节点之前,几乎可以肯定代表特定配料的用量。
存在其他纯文本食谱格式,例如 Markdown 的 杂货食谱格式 以及 Cooklang 中使用的纯文本格式,但作者认为这些格式的阅读性不如食谱风 Markdown。虽然上述格式更为具体,但食谱风 Markdown 采用了一种更开放的方法,选择最小的语法而不是严格的定义。由于食谱风 Markdown 的灵活性,使用此包的应用程序需要自行确定用户的意图。作者认为这种方法比强迫用户密切关注其食谱语法更好。
通过允许烹饪用量松散地存在于纯文本中,并利用 Markdown 允许没有显式 URL 的链接这一事实,我们可以创造一种更简单、更灵活、(希望如此)更易读的纯文本食谱格式。增加的灵活性允许用户以他们可读的方式编写食谱,同时仍然提供足够的信息供程序分析。
食谱风 Markdown 不强制要求在食谱中表示“配料”和“说明”部分的特定语法,尽管预计用户很可能会使用某种标题语法。
鸣谢
项目由?Very Good CLI 生成。