You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the @? operator for marking ingredients as optional, following
the cooklang-rs extension convention. Optional ingredients are displayed
with '(optional)' suffix in all output formats.
Changes:
- Add OPTIONAL_INGREDIENT token type and lexer support
- Update parser to handle @? and set Optional field on components
- Add Optional bool field to Ingredient struct
- Update Render() and RenderDisplay() methods for optional ingredients
- Add optional ingredient support to HTML, Markdown, and Print renderers
- Add spec tests and parser/lexer unit tests
- Add example Gin_and_Tonic.cook recipe demonstrating optional garnishes
Example usage:
Add @?thyme{2%sprigs} if desired.
Garnish with @?lime wedge{1} or @?lemon wheel{1}.
0 commit comments