Recipe-flavored markdown: make recipes easy to create and maintain

Overview

Recipe-Flavored Markdown

Coverage style: very good analysis License: MIT

Have you ever wanted a simpler approach to writing and maintaining recipes? Are you tired of fidgeting with apps that make it hard to specify ingredients or instructions for all your tasty, sacred texts? Would you rather take matters into your own hands and write recipes using nothing but a plain-text editor?

Note: This is a passion project that is still in its infancy. Feel free to make suggestions!

Meet recipe-flavored markdown! Using nothing but markdown, you can write your tasty tomes in a loosely-opinionated way that reads almost exactly like your grandmother's (or grandfather's!) recipes. Better yet, this package allows you to parse recipe-flavored markdown documents in Dart and use them however you like! Let's get to cookin'!

Below is what a recipe for Cinnamon Rolls might look like in recipe-flavored 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!

About

Recipe-flavored markdown builds on Dart's markdown package by adding syntax extensions and a link resolver.

Unresolved links are marked as references, allowing developers utilizing this package to determine if the link refers to an ingredient, cooking supply, or even another recipe. Cooking quantities are recognized within the markdown document wherever they occur using syntax extensions, such as 1 3/4 cups. Developers utilizing this package can walk through the markdown syntax tree nodes looking for Quantity and Reference nodes. For example, a Quantity node that occurs before a Reference node on the same line of text almost certainly represents the quantity for a specific ingredient.

There are other plain text recipe formats, such as the markdown Grocery Recipe Format and the plain text format used in Cooklang, but the author feels these do not read as easily. While the aforementioned formats are more specific, recipe-flavored markdown opts for a more open-ended approach, choosing minimal syntax over rigorous definition. Because of the flexibility of recipe-flavored markdown, applications utilizing this package are left with the complexity of determining what the user meant. The author feels this approach is better than forcing the user to be keenly aware of their recipe syntax.

By allowing cooking quantities to exist within plain text loosely and exploiting the fact that markdown allows links without explicit url's, we can concoct a simpler, more flexible, and (hopefully) more readable plain text recipe format. The added flexibility allows users to write recipes in a way that is readable to them, while still providing enough information for programmatic analysis.

Recipe-flavored markdown does not insist on a specific syntax for denoting "Ingredients" and "Instructions" sections within recipes, although it is expected the user will likely use some form of heading syntax.

Usage

To parse markdown-flavored recipe text, add the following code to your project:

const recipe = '1 3/4 cups [sugar]';

const parser = RecipeMarkdownParser(
  markdown: recipe,
);

final nodes = parser.parse();

Like the standard markdown package, nodes will have the type List<Node>. You can then walk through the nodes, examining their children and looking for the Quantity and Reference nodes that are specific to recipe-flavored markdown. :)

For a complete demonstration of how to parse recipe-flavored markdown strings within Dart, see recipe_markdown_parser_test.dart

Credits

Project generated by 🦄 Very Good CLI.

You might also like...

An end-to-end Flutter app built to get details and trending recipes - made as a part of the book 'Flutter Apprentice' by raywenderlich.com

Fooderlich - Flutter Apprentice An end-to-end Flutter app built to get details and trending recipes - made as a part of the book 'Flutter Apprentice'

Dec 4, 2021

My first Flutter project - a recipes app, from the book Flutter Apprentice.

recipes My first Flutter project - a recipes app, from the book Flutter Apprentice. Getting Started This project is a starting point for a Flutter app

Dec 28, 2021

A simple recipes app made in Flutter for a series of articles

A simple recipes app made in Flutter for a series of articles

recipes_app Simple Recipes App made in Flutter for a series of articles. You can find all articles here. Branches are regarding to articles: 01_introd

Dec 21, 2022

Starter architectures for your next Flutter project in order to make it scalable and easy for maintenance and tests.

👷 🔧 🔩 Flutter Starter Architecture (MVVM) My custom starter project for Flutter apps. I was looking for a simple way to build Flutter app in a scal

Dec 25, 2022

A Recipe app with spoonacular API.

Flutter-Bloc-Recipe-app App Features. App includes 5,0000+ recipes. cost breakdown per servings. related Recipes. Auto Complete search Feature. Save r

Jan 3, 2023

Recipe App made with Flutter

Recipe App made with Flutter

Recipe App made with Flutter

Oct 12, 2022

A nice clean recipe app UI using flutter.

A nice clean recipe app UI using flutter.

Recipe App - Flutter UI Watch it on YouTube Also work on both landscape and portrait mood Packages we are using: flutter_svg: link provider: link Try

Dec 17, 2022

A Recipe app with spoonacular API.

A Recipe app with spoonacular API.

Flutter-Bloc-Recipe-app App Features. App includes 5,0000+ recipes. cost breakdown per servings. related Recipes. Auto Complete search Feature. Save r

Sep 27, 2022

Calculate your pizza recipe in a few seconds! 🍕

Calculate your pizza recipe in a few seconds! 🍕

Calcolapizza Calcolapizza lets you calculate the exact recipe for your pizza doughs in a few seconds. Set how many dough balls you want to make, their

Dec 26, 2022
Comments
  • Thoughts about image links

    Thoughts about image links

    I personally think that images are a core part of a recipe. It's probably not too difficult to manually parse for markdown image links but would you consider making it part of the RFM parser? Something like:

    final nodes = (parser.parse()[0] as Element).children!.cast<Element>();
          expect(
            nodes[0].children![1],
            isA<Hyperlink>().having(
              (q) => q.textContent,
              'textContent',
              'i.imgur.com/Gvifg5f.jpg',
            ),
          );
    
    opened by veltall 8
Releases(v1.0.0)
  • v1.0.0(Jan 26, 2022)

    • Introducing recipe_flavored_markdown!
    • Scalar nodes represent a cooking time or quantity, such as 1 3/4 cup or 30 minutes
    • Reference nodes represent an unresolved reference to an ingredient, cooking supply, another recipe, or whatever you like!
    Source code(tar.gz)
    Source code(zip)
Owner
Joanna May
Making magic at 🦄 Very Good Ventures!
Joanna May
This is not an app. I made this architecture to build robust and easy-to-maintain products but in a faster way.

simple_architecture_flutter This is not an app. I made this architecture to build robust and easy-to-maintain products but in a faster way. Info I use

Batuhan Karababa 9 Oct 28, 2022
Kind of app that generally used to maintain our day-to-day tasks or list everything that we have to do.We can add more tasks at any time and delete a task that is completed.

todo_application A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Khaled Elnkhla 0 Nov 6, 2021
Weight Loss Tracker is an application dedicated to people who want to dump or maintain weight

Weight Loss Tracker is an application dedicated to people who want to dump or maintain weight. It allows you to keep an eye on your progress and pursue your weight goals.

Senior Mobile Developer 5 Jan 3, 2023
Convert quill (Delta) fromat to and from markdown

Limitation Image Currently this convertor doesn't support image alts, only image src will be retained Block attributes exclusivity flutter_quill block

Tarekk Mohamed Abdalla 6 May 20, 2022
Convert quill (Delta) fromat to and from markdown

Markdown Quill ⚠️ [Please note this package is under development the API might change]. Provides converters to convert from markdown to quill (Delta)

Tarekk Mohamed Abdalla 6 May 20, 2022
Android app that converts an URL to markdown, and lets you share it to your favorite notes app.

markdownr Android app that converts an URL to markdown, and lets you share it to your favorite notes app. I've written this app to save articles I fou

Andrea Ghensi 41 Dec 10, 2022
A simple note-taking app with a markdown editor, built with Flutter and Firebase

Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project:

Dev-Salem 150 Dec 25, 2022
Simple markdown editor. with custom keyboard helper for making bold, italic, list, URL, photoURL, etc

Flutter Markdown Editor A simple markdown creator/editor application, developer with flutter. special auxiliary keyboard features (for develop markdow

Ismael Shakverdiev 36 Dec 15, 2022
cosmic_frontmatter is a package that provides a simple way to parse the frontmatter of a markdown file.

cosmic_frontmatter cosmic_frontmatter is a package that provides a simple way to parse the frontmatter of a markdown file. Getting started To get star

cosmic.horse 9 Oct 26, 2022
A Markdown-based note-taking app for mobile devices.

Noteless A markdown-based note-taking app for Android Compatible with notes saved in Notable Features Markdown-optimized editor with syntax highlighti

null 460 Dec 31, 2022