Cooklang parser in Elixir using nimbleparsec.
Installation
def deps do
[
{:cooklang_parser, "~> 0.1.0"}
]
endUsage
iex> CooklangParser.parse("Add @salt and @ground black pepper{1/2%tsp}.")
{:ok,
[
step: [
text: "Add ",
ingredient: [name: "salt"],
text: " and ",
ingredient: [name: "ground black pepper", quantity: 0.5, unit: "tsp"],
text: "."
]
]}Spec
Implements the Cooklang spec and is tested against its canonical tests.