If you want to embed machine-readable metadata (like ingredients and their amounts) in an otherwise human-readable Markdown document—especially for recipes—the common and modern solution is to use embedded structured data formats. The most common approaches are:
✅ 1. Embedded JSON-LD Block (Structured Data)
JSON-LD (JavaScript Object Notation for Linked Data) is the most widely used method to embed structured data for things like recipes. It’s supported by schema.org and used by Google and other platforms for rich search results.
Example in Markdown:
markdownCopiarEditar# Grandma's Apple Pie
A classic pie recipe passed down generations.
Ingredients
- 2 cups flour
- 1 cup sugar
- 3 apples
Instructions
- Mix the flour and sugar.
- Add sliced apples.
- Bake at 350°F for 45 minutes.
✅ Machine-readable (Google, search engines)
✅ Keeps Markdown clean
🚫 Not easily visible in plain Markdown viewers (but this is a feature in some cases)
✅ 2. Markdown with Frontmatter (YAML)
If the entire document is Markdown and intended for processing/rendering (like in a static site generator), YAML frontmatter is very common.
Example:
markdownCopiarEditar---
title: "Grandma's Apple Pie"
ingredients:
- ingredient: flour
amount: 2 cups
- ingredient: sugar
amount: 1 cup
- ingredient: apples
amount: 3
Grandma's Apple Pie
Ingredients
- 2 cups flour
- 1 cup sugar
- 3 apples
Instructions
- Mix the flour and sugar.
- Add sliced apples.
- Bake at 350°F for 45 minutes.
✅ Widely supported in Markdown tooling (Jekyll, Hugo, etc.)
✅ Easily human- and machine-readable
🚫 Metadata is separated from visual list in the body
✅ 3. Inline Custom Syntax (if you’re building your own parser or extensions)
You can define special syntax hints for ingredients inline. Example using @ingredient: or {{ }} or similar:
markdownCopiarEditar- @ingredient[flour](2 cups)
- @ingredient[sugar](1 cup)
- @ingredient
or
markdownCopiarEditar- {{ingredient: flour, amount: 2 cups}}
✅ Good for custom renderers
✅ Flexible
🚫 Not standardized
🚫 Not machine-readable unless your parser understands it
Summary Table:
FormatMachine-readableMarkdown-nativeHuman-readableStandardJSON-LD block✅🚫 (HTML embed)✅✅ (schema.org)YAML Frontmatter✅✅✅✅ (in SSGs)Custom inline tags⚠ (custom only)✅✅🚫
Recommendation:
If your goal is to support rich metadata extraction, JSON-LD with schema.org or YAML frontmatter is the best choice. For Markdown that's meant to be parsed by a static site or recipe app, YAML is usually ideal.
Would you like help generating a schema.org-compliant JSON-LD block for your recipe?