Directions now correctly converted from Markdown to HTML
This commit is contained in:
parent
6c163c11a7
commit
4c312cc3f7
16
build.py
16
build.py
@ -13,6 +13,15 @@ with open('menu.yaml', 'r') as file:
|
||||
templateMenu = env.get_template("menu.html")
|
||||
templateRecipes = env.get_template("recipes.html")
|
||||
|
||||
for bev in menu['menu']:
|
||||
#print(bev)
|
||||
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'])
|
||||
|
||||
with open('index.html', 'w') as file:
|
||||
file.write(templateMenu.render(bevs = menu['menu']))
|
||||
|
||||
@ -21,13 +30,6 @@ with open('recipes.html', 'w') as file:
|
||||
|
||||
print(menu['menu'])
|
||||
|
||||
for bev in menu['menu']:
|
||||
#print(bev)
|
||||
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']))
|
||||
|
||||
for ingredient in menu['out_of_stock']:
|
||||
print(ingredient)
|
||||
|
||||
56
recipes.html
56
recipes.html
@ -26,9 +26,10 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Stir with ice. Strain into rocks glass over large cube.
|
||||
1. Garnish with orange twist.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Stir with ice. Strain into rocks glass over large cube.</li>
|
||||
<li>Garnish with orange twist.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
@ -51,9 +52,10 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Stir with ice. Strain into rocks glass over large cube.
|
||||
1. Garnish with orange twist.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Stir with ice. Strain into rocks glass over large cube.</li>
|
||||
<li>Garnish with orange twist.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
@ -80,9 +82,10 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Stir with ice. Strain into chilled coupe.
|
||||
1. Garnish with orange twist.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Stir with ice. Strain into chilled coupe.</li>
|
||||
<li>Garnish with orange twist.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
@ -109,9 +112,10 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Stir with ice. Strain into rocks glass over large cube.
|
||||
1. Garnish with orange twist.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Stir with ice. Strain into rocks glass over large cube.</li>
|
||||
<li>Garnish with orange twist.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
@ -134,8 +138,9 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Shake with ice. Double strain into chilled coupe.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Shake with ice. Double strain into chilled coupe.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
@ -154,10 +159,11 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Pour gin and tonic over ice in short glass.
|
||||
1. Stir gently.
|
||||
1. Garnish with lime wheel.
|
||||
</p>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
@ -180,9 +186,10 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Shake with ice.
|
||||
1. Double strain into chilled coupe.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Shake with ice.</li>
|
||||
<li>Double strain into chilled coupe.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
@ -209,9 +216,10 @@
|
||||
</ul>
|
||||
|
||||
<h3>Directions</h3>
|
||||
<p>1. Shake with ice.
|
||||
1. Double strain into chilled coupe.
|
||||
</p>
|
||||
<p><ol>
|
||||
<li>Shake with ice.</li>
|
||||
<li>Double strain into chilled coupe.</li>
|
||||
</ol></p>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
{% block amount %}{{ amount }} {% endblock %}
|
||||
{% block directions %}
|
||||
<h3>Directions</h3>
|
||||
<p>{{ details['directions'] }}</p>
|
||||
<p>{{ details['directions_html']|safe }}</p>
|
||||
{% endblock %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user