From 2500cfb546bf897f74f463695159a0421b746a78 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Thu, 23 Jan 2025 21:47:49 -0500 Subject: [PATCH] Writing generator in python. MVP working --- build.pl | 26 ++++++++- index.html | 159 +++++++++++++---------------------------------------- menu.yaml | 10 ++++ 3 files changed, 71 insertions(+), 124 deletions(-) diff --git a/build.pl b/build.pl index 4010058..d3d56f0 100755 --- a/build.pl +++ b/build.pl @@ -1,12 +1,32 @@ #!/usr/bin/perl - +use strict; +use warnings; use feature qw(say); -use Text::Markup::Markdown; +use Data::Dumper; +#use Text::Markup::Markdown; +use YAML::PP; +my $ypp = YAML::PP->new; -my $html = Text::Markup->new->parse(file => 'menu.md'); +#my $html = Text::Markup->new->parse(file => 'menu.md'); +my %menu = $ypp->load_file("menu.yaml"); open my $fh, ">", "index.html"; +my $html = <<~EoF; + + + Cocktail Menu + + + + EoF + +$html .= "Hi"; + +#say Dumper(@menu); +say "Menu"; +say Dumper($menu{menu}); + print $fh $html; diff --git a/index.html b/index.html index 002efda..450c68a 100644 --- a/index.html +++ b/index.html @@ -1,127 +1,44 @@ - + +Cocktail Menu -

Old Fashioned

- - - -

Sidecar

- - - -

Gin & Tonic

- - - -

Gimlet

- - - -

Bennet

- - - -

Whiskey Sour

- - - -

Negroni

- - - -

Boulevardier

- - - -

Campari & Soda

- - - -

Bee's Knees

- - - -

Manhattan

- - - -

Black Manhattan

- - - -

Rusty Nail

- - - -

Basil Gimlet

- - - -

Daiquiri

- - - +

Old Fashioned

+ +

Boulevardier

+ +

Sidecar

+ +

Gin & Tonic

+ +

Gimlet

+ +

Bennet

+ diff --git a/menu.yaml b/menu.yaml index 23265df..c7d1c57 100644 --- a/menu.yaml +++ b/menu.yaml @@ -7,6 +7,13 @@ menu: - Bourbon - Maple syrup - Angostura bitters + - Boulevardier: + base: Bourbon + category: Spirit-Forward + ingredients: + - Bourbon + - Campari + - Sweet vermouth - Sidecar: base: Bourbon category: Sours @@ -35,3 +42,6 @@ menu: - Lime juice - Simple syrup - Angostura bitters + +out_of_stock: + - Rye whiskey