Improve output HTML tags for styling.
This commit is contained in:
parent
dc86a9235e
commit
b8cc999ffd
@ -59,9 +59,11 @@ print("<!DOCTYPE html>")
|
|||||||
print("<html lang='en'>")
|
print("<html lang='en'>")
|
||||||
print(f"<head><title>{recipe_name}</title>")
|
print(f"<head><title>{recipe_name}</title>")
|
||||||
print("<link rel='stylesheet' type='text/css' href='style.css'>")
|
print("<link rel='stylesheet' type='text/css' href='style.css'>")
|
||||||
|
print("<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>")
|
||||||
print("</head>")
|
print("</head>")
|
||||||
print("<body>")
|
print("<body>")
|
||||||
|
|
||||||
|
print("<header>")
|
||||||
print("<div id='title'>")
|
print("<div id='title'>")
|
||||||
print(f"<h1>{recipe_name}</h1>")
|
print(f"<h1>{recipe_name}</h1>")
|
||||||
print("</div>")
|
print("</div>")
|
||||||
@ -69,14 +71,19 @@ print("</div>")
|
|||||||
print("<div id='description'>")
|
print("<div id='description'>")
|
||||||
print(f"<p>{recipe_desc}</p>")
|
print(f"<p>{recipe_desc}</p>")
|
||||||
print("</div>")
|
print("</div>")
|
||||||
|
print("</header>")
|
||||||
|
|
||||||
|
print("<main>")
|
||||||
print("<div id='needs'>")
|
print("<div id='needs'>")
|
||||||
print("<h2>Needs</h2>")
|
print("<h2>Needs</h2>")
|
||||||
print("<ul>")
|
print("<ul>")
|
||||||
|
|
||||||
for sub_recipe in sub_recipes:
|
for sub_recipe in sub_recipes:
|
||||||
for ingredient in sub_recipe.leaves:
|
for ingredient in sub_recipe.leaves:
|
||||||
print(f" <li>{ingredient.name}</li>")
|
if ingredient.description:
|
||||||
|
print(f" <li>{ingredient.name} -- {ingredient.description}</li>")
|
||||||
|
else:
|
||||||
|
print(f" <li>{ingredient.name}</li>")
|
||||||
|
|
||||||
print("</ul>")
|
print("</ul>")
|
||||||
print("</div>")
|
print("</div>")
|
||||||
@ -92,8 +99,9 @@ for sub_recipe in sub_recipes:
|
|||||||
|
|
||||||
print("</ol>")
|
print("</ol>")
|
||||||
print("</div>")
|
print("</div>")
|
||||||
|
print("</main>")
|
||||||
|
|
||||||
print("<div id='tables'>")
|
print("<summary>")
|
||||||
print("<h2>Tabular Layout</h2>")
|
print("<h2>Tabular Layout</h2>")
|
||||||
|
|
||||||
for sub_recipe in sub_recipes:
|
for sub_recipe in sub_recipes:
|
||||||
@ -116,7 +124,7 @@ for sub_recipe in sub_recipes:
|
|||||||
print("</table>")
|
print("</table>")
|
||||||
print("</p>")
|
print("</p>")
|
||||||
|
|
||||||
print("</div>")
|
print("</summary>")
|
||||||
|
|
||||||
print("</body>")
|
print("</body>")
|
||||||
print("</html>")
|
print("</html>")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user