Output full webpage html
This commit is contained in:
parent
4bf120ec8d
commit
b0a3901df3
@ -1,6 +1,5 @@
|
||||
import json
|
||||
|
||||
from anytree import LevelOrderIter, LevelOrderGroupIter
|
||||
from anytree.importer import DictImporter
|
||||
from sys import argv
|
||||
|
||||
@ -56,8 +55,22 @@ recipe_desc = recipe.get("description")
|
||||
importer = DictImporter()
|
||||
sub_recipes = [importer.import_(data) for data in recipe["sub_recipes"]]
|
||||
|
||||
print("<!DOCTYPE html>")
|
||||
print("<html lang='en'>")
|
||||
print(f"<head><title>{recipe_name}</title>")
|
||||
print("<link rel='stylesheet' type='text/css' href='style.css'>")
|
||||
print("</head>")
|
||||
print("<body>")
|
||||
|
||||
print("<div id='title'>")
|
||||
print(f"<h1>{recipe_name}</h1>")
|
||||
print("</div>")
|
||||
|
||||
print("<div id='description'>")
|
||||
print(f"<p>{recipe_desc}</p>")
|
||||
print("</div>")
|
||||
|
||||
print("<div id='needs'>")
|
||||
print("<h2>Needs</h2>")
|
||||
print("<ul>")
|
||||
|
||||
@ -66,8 +79,10 @@ for sub_recipe in sub_recipes:
|
||||
print(f" <li>{ingredient.name}</li>")
|
||||
|
||||
print("</ul>")
|
||||
print("</div>")
|
||||
|
||||
print("<h2>Steps</h2>")
|
||||
print("<div id='preparation'>")
|
||||
print("<h2>Preparation</h2>")
|
||||
print("<ol>")
|
||||
|
||||
for sub_recipe in sub_recipes:
|
||||
@ -76,9 +91,14 @@ for sub_recipe in sub_recipes:
|
||||
print(f" <li>{task}</li>")
|
||||
|
||||
print("</ol>")
|
||||
print("</div>")
|
||||
|
||||
print("<div id='tables'>")
|
||||
print("<h2>Tabular Layout</h2>")
|
||||
|
||||
for sub_recipe in sub_recipes:
|
||||
print("<table cellspacing='0'>")
|
||||
print("<p>")
|
||||
print("<table cellspacing='0' border=true>")
|
||||
|
||||
output_rows = []
|
||||
|
||||
@ -94,3 +114,9 @@ for sub_recipe in sub_recipes:
|
||||
print("</tr>")
|
||||
|
||||
print("</table>")
|
||||
print("</p>")
|
||||
|
||||
print("</div>")
|
||||
|
||||
print("</body>")
|
||||
print("</html>")
|
||||
|
Loading…
x
Reference in New Issue
Block a user