Compare commits

..

No commits in common. "94c46143a9ffe180f551b0f70135190250974cac" and "75e97b9d4a56ebe20ef64ccb4913af993dc92453" have entirely different histories.

10 changed files with 528 additions and 197 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
*.html

View File

@ -1,18 +0,0 @@
FROM python:3.12
WORKDIR /usr/local/app
# Install the application dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy in the source code
COPY . .
EXPOSE 5000
# Setup an app user so the container doesn't run as the root user
RUN useradd app
USER app
CMD ["cd", "/usr/local/app"]
CMD "ls"
CMD ["flask", "--app", "build", "run", "--host=0.0.0.0"]]

View File

@ -7,51 +7,29 @@ env = Environment(
autoescape=select_autoescape()
)
def generateMenu():
with open('menu.yaml', 'r') as file:
menu = yaml.safe_load(file)
templateMenu = env.get_template("menu.html")
templateRecipes = env.get_template("recipes.html")
for bev, details in menu['menu'].items():
for bev in menu['menu']:
#print(bev)
print(bev)
#for ingredient in details['ingredients']:
# print(f'<li>{ingredient[list(ingredient)[0]]} {list(ingredient)[0]}</li>')
details['directions_html'] = markdown.markdown(details['directions'])
for name in bev:
print(name)
for ingredient in bev[name]['ingredients']:
print(f'<li>{ingredient[list(ingredient)[0]]} {list(ingredient)[0]}</li>')
print(markdown.markdown(bev[name]['directions']))
bev[name]['directions_html'] = markdown.markdown(bev[name]['directions'])
menuHtml = templateMenu.render(bevs = menu['menu'])
recipesHtml = templateRecipes.render(bevs = menu['menu'])
return {'menuHtml': menuHtml, 'recipesHtml': recipesHtml}
if (__name__ == 'build'):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def serveMenu():
return generateMenu()['menuHtml']
@app.route("/recipes")
def serveRecipes():
return generateMenu()['recipesHtml']
elif (__name__ == '__main__'):
html = generateMenu()
with open('index.html', 'w') as file:
file.write(html['menuHtml'])
file.write(templateMenu.render(bevs = menu['menu']))
with open('recipes.html', 'w') as file:
file.write(html['recipesHtml'])
file.write(templateRecipes.render(bevs = menu['menu']))
print(menu['menu'])
print(generateMenu())
#print(menu)
#
#
#
#for ingredient in menu['out_of_stock']:
# print(ingredient)
#
#print(__name__)
for ingredient in menu['out_of_stock']:
print(ingredient)

183
index.html Normal file
View File

@ -0,0 +1,183 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<title>Cocktail Menu</title>
</head>
<body class="menu">
<main>
<h1>Cocktails</h1>
<h2>Old Fashioned</h2>
<ul>
<li>Bourbon</li>
<li>Maple syrup</li>
<li>Angostura bitters</li>
</ul>
<h2>Boulevardier</h2>
<ul>
<li>Bourbon</li>
<li>Campari</li>
<li>Sweet vermouth</li>
</ul>
<h2>Black Manhattan</h2>
<ul>
<li>Rye whiskey</li>
<li>Amaro</li>
<li>Angostura bitters</li>
<li>Orange bitters</li>
</ul>
<h2>MonteNegroni</h2>
<ul>
<li>Amaro Montenegro</li>
<li>Gin</li>
<li>Sweet vermouth</li>
<li>Angostura bitters</li>
</ul>
<h2>Sidecar</h2>
<ul>
<li>Bourbon</li>
<li>Cointreau</li>
<li>Lemon juice</li>
</ul>
<h2>Gin &amp; Tonic</h2>
<ul>
<li>Gin</li>
<li>Tonic water</li>
</ul>
<h2>Gimlet</h2>
<ul>
<li>Gin</li>
<li>Lime juice</li>
<li>Simple syrup</li>
</ul>
<h2>Bennet</h2>
<ul>
<li>Gin</li>
<li>Lime juice</li>
<li>Simple syrup</li>
<li>Angostura bitters</li>
</ul>
</main>
</body>
</html>

103
menu.yaml
View File

@ -1,122 +1,87 @@
---
menu:
Old Fashioned:
- Old Fashioned:
base: Bourbon
category: Ancestrals
ingredients:
Bourbon: 2 oz
Maple syrup: 1tsp
Angostura bitters: 2 dashes
- Bourbon: 2 oz
- Maple syrup: 1tsp
- Angostura bitters: 2 dashes
directions: |
1. Stir with ice. Strain into rocks glass over large cube.
1. Garnish with orange twist.
Boulevardier:
- Boulevardier:
base: Bourbon
category: Spirit-Forward
ingredients:
Bourbon: 1.5 oz
Campari: 1 oz
Sweet vermouth: 1 oz
- Bourbon: 1.5 oz
- Campari: 1 oz
- Sweet vermouth: 1 oz
directions: |
1. Stir with ice. Strain into rocks glass over large cube.
1. Garnish with orange twist.
Manhattan:
base: Bourbon
category: Ancestrals
ingredients:
Bourbon: 1.5 oz
Sweet vermouth: 1 oz
Angostura bitters: 2 dashes
directions: |
1. Stir with ice.
2. Strain into chilled coupe.
3. Garnish with cherry or orange twist.
Black Manhattan:
- Black Manhattan:
base: Rye whiskey
category: Spirit-Forward
ingredients:
Rye whiskey: 2 oz
Amaro: 1 oz
Angostura bitters: 1 dash
Orange bitters: 1 dash
- Rye whiskey: 2 oz
- Amaro: 1 oz
- Angostura bitters: 1 dash
- Orange bitters: 1 dash
directions: |
1. Stir with ice. Strain into chilled coupe.
1. Garnish with orange twist.
MonteNegroni:
- MonteNegroni:
base: Amaro Montenegro & Gin
category:
ingredients:
Amaro Montenegro: 1 1/3 oz
Gin: 2/3 oz
Sweet vermouth: 2/3 oz
Angostura bitters: 2 drops
- Amaro Montenegro: 1 1/3 oz
- Gin: 2/3 oz
- Sweet vermouth: 2/3 oz
- Angostura bitters: 2 drops
directions: |
1. Stir with ice. Strain into rocks glass over large cube.
1. Garnish with orange twist.
Sidecar:
- Sidecar:
base: Bourbon
category: Sours
ingredients:
Bourbon: 2 oz
Cointreau: 1 oz
Lemon juice: 0.5 oz
- Bourbon: 2 oz
- Cointreau: 1 oz
- Lemon juice: 0.5 oz
directions: |
1. Shake with ice. Double strain into chilled coupe.
"Gin & Tonic":
- "Gin & Tonic":
base: Gin
category: Highballs
ingredients:
Gin: 2 oz
Tonic water: 4 oz
- Gin: 2 oz
- Tonic water: 4 oz
directions: |
1. Pour gin and tonic over ice in short glass.
1. Stir gently.
1. Garnish with lime wheel.
Gimlet:
- Gimlet:
base: Gin
category: Sours
ingredients:
Gin: 2 oz
Lime juice: 1 oz
Simple syrup: 0.5 oz
- Gin: 2 oz
- Lime juice: 1 oz
- Simple syrup: 0.5 oz
directions: |
1. Shake with ice.
1. Double strain into chilled coupe.
Bennet:
- Bennet:
base: Gin
category: Sours
ingredients:
Gin: 2 oz
Lime juice: 1 oz
Simple syrup: 0.5 oz
Angostura bitters: 1 dash
- Gin: 2 oz
- Lime juice: 1 oz
- Simple syrup: 0.5 oz
- Angostura bitters: 1 dash
directions: |
1. Shake with ice.
1. Double strain into chilled coupe.
Garibaldi:
base: Campari
category: Highballs
ingredients:
Campari: 1.5 oz
Orange juice: 4.5 oz
directions: |
1. Blend orange juice and Campari until frothy.
1. Strain into ice-filled highball.
White Russian:
base: Vodka
category:
ingredients:
Vodka: 1.5 oz
Kahlua: 1 oz
Heavy cream: 1 oz
Instant coffee: 0.5 tsp
directions: |
1. Chill vodka
1. Add large cube to lowball glass
1. Sprinkle instant coffee powder over ice
1. Slowly pour vodka around ice
1. Slowly pour Kahlua around ice
1. Slowly pour cream over ice
out_of_stock:
- Rye whiskey

231
recipes.html Normal file
View File

@ -0,0 +1,231 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<title>Cocktail Menu</title>
</head>
<body class="recipes">
<main>
<h1>Recipes</h1>
<h2>Old Fashioned</h2>
<ul>
<li>2 oz Bourbon</li>
<li>1tsp Maple syrup</li>
<li>2 dashes Angostura bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into rocks glass over large cube.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>Boulevardier</h2>
<ul>
<li>1.5 oz Bourbon</li>
<li>1 oz Campari</li>
<li>1 oz Sweet vermouth</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into rocks glass over large cube.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>Black Manhattan</h2>
<ul>
<li>2 oz Rye whiskey</li>
<li>1 oz Amaro</li>
<li>1 dash Angostura bitters</li>
<li>1 dash Orange bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into chilled coupe.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>MonteNegroni</h2>
<ul>
<li>1 1/3 oz Amaro Montenegro</li>
<li>2/3 oz Gin</li>
<li>2/3 oz Sweet vermouth</li>
<li>2 drops Angostura bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into rocks glass over large cube.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>Sidecar</h2>
<ul>
<li>2 oz Bourbon</li>
<li>1 oz Cointreau</li>
<li>0.5 oz Lemon juice</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Shake with ice. Double strain into chilled coupe.</li>
</ol></p>
<h2>Gin &amp; Tonic</h2>
<ul>
<li>2 oz Gin</li>
<li>4 oz Tonic water</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Pour gin and tonic over ice in short glass.</li>
<li>Stir gently.</li>
<li>Garnish with lime wheel.</li>
</ol></p>
<h2>Gimlet</h2>
<ul>
<li>2 oz Gin</li>
<li>1 oz Lime juice</li>
<li>0.5 oz Simple syrup</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Shake with ice.</li>
<li>Double strain into chilled coupe.</li>
</ol></p>
<h2>Bennet</h2>
<ul>
<li>2 oz Gin</li>
<li>1 oz Lime juice</li>
<li>0.5 oz Simple syrup</li>
<li>1 dash Angostura bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Shake with ice.</li>
<li>Double strain into chilled coupe.</li>
</ol></p>
</main>
</body>
</html>

View File

@ -1,11 +0,0 @@
blinker==1.9.0
click==8.1.8
Flask==3.1.0
importlib_metadata==8.6.1
itsdangerous==2.2.0
Jinja2==3.1.5
Markdown==3.7
MarkupSafe==3.0.2
PyYAML==6.0.2
Werkzeug==3.1.3
zipp==3.21.0

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="static/style.css">
<link rel="stylesheet" href="style.css">
<title>{% block title %}{% endblock %}</title>
</head>
<body class="{% block bodyclass %}{% endblock %}">

View File

@ -3,13 +3,17 @@
{% block bodyclass %}menu{% endblock %}
{% block content %}
<h1>{% block header %}Cocktails{% endblock %}</h1>
{% for name, details in bevs.items() %}
{% for bev in bevs %}
{% for name, details in bev.items() %}
<h2>{{ name }}</h2>
<ul>
{% for name, amount in details['ingredients'].items() %}
{% for ingredient in details['ingredients'] %}
{% for name, amount in ingredient.items() %}
<li>{% block amount scoped %}{% endblock %}{{ name }}</li>
{% endfor %}
{% endfor %}
</ul>
{% block directions scoped %}{% endblock %}
{% endfor %}
{% endfor %}
{% endblock %}