Skip to content

Instantly share code, notes, and snippets.

@cpfiffer
Created May 30, 2025 06:51
Show Gist options
  • Save cpfiffer/7d6e1571ac667555cbe24ef86716290b to your computer and use it in GitHub Desktop.
Save cpfiffer/7d6e1571ac667555cbe24ef86716290b to your computer and use it in GitHub Desktop.
start: recipe
recipe: declaration_section ingredient_section instruction_section notes_section end
// The declaration of the recipe
declaration_section: declaration
declaration: "# " recipe_name
recipe_name: /[a-zA-Z0-9 ]+\n/
// The ingredients of the recipe
ingredient_section: "## Ingredients\n" ingredients
ingredients: ingredient+
ingredient: "- " ingredient_text
ingredient_text: /[a-zA-Z0-9 ]+\n/
// The instructions of the recipe
instruction_section: "## Instructions\n" instructions
instructions: instruction+
instruction_number: /[0-9]+\./
instruction: instruction_number instruction_text
instruction_text: /[a-zA-Z0-9 ]+\n/
// The notes of the recipe
notes_section: "## Notes\n" notes
notes: note+
note: "- " note_text
note_text: /[a-zA-Z0-9 ]+\n/
end: "## End\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment