Output full webpage html
This commit is contained in:
джерело
4bf120ec8d
коміт
b0a3901df3
@ -1,6 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from anytree import LevelOrderIter, LevelOrderGroupIter
|
|
||||||
from anytree.importer import DictImporter
|
from anytree.importer import DictImporter
|
||||||
from sys import argv
|
from sys import argv
|
||||||
|
|
||||||
@ -56,8 +55,22 @@ recipe_desc = recipe.get("description")
|
|||||||
importer = DictImporter()
|
importer = DictImporter()
|
||||||
sub_recipes = [importer.import_(data) for data in recipe["sub_recipes"]]
|
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(f"<h1>{recipe_name}</h1>")
|
||||||
|
print("</div>")
|
||||||
|
|
||||||
|
print("<div id='description'>")
|
||||||
print(f"<p>{recipe_desc}</p>")
|
print(f"<p>{recipe_desc}</p>")
|
||||||
|
print("</div>")
|
||||||
|
|
||||||
|
print("<div id='needs'>")
|
||||||
print("<h2>Needs</h2>")
|
print("<h2>Needs</h2>")
|
||||||
print("<ul>")
|
print("<ul>")
|
||||||
|
|
||||||
@ -66,8 +79,10 @@ for sub_recipe in sub_recipes:
|
|||||||
print(f" <li>{ingredient.name}</li>")
|
print(f" <li>{ingredient.name}</li>")
|
||||||
|
|
||||||
print("</ul>")
|
print("</ul>")
|
||||||
|
print("</div>")
|
||||||
|
|
||||||
print("<h2>Steps</h2>")
|
print("<div id='preparation'>")
|
||||||
|
print("<h2>Preparation</h2>")
|
||||||
print("<ol>")
|
print("<ol>")
|
||||||
|
|
||||||
for sub_recipe in sub_recipes:
|
for sub_recipe in sub_recipes:
|
||||||
@ -76,9 +91,14 @@ for sub_recipe in sub_recipes:
|
|||||||
print(f" <li>{task}</li>")
|
print(f" <li>{task}</li>")
|
||||||
|
|
||||||
print("</ol>")
|
print("</ol>")
|
||||||
|
print("</div>")
|
||||||
|
|
||||||
|
print("<div id='tables'>")
|
||||||
|
print("<h2>Tabular Layout</h2>")
|
||||||
|
|
||||||
for sub_recipe in sub_recipes:
|
for sub_recipe in sub_recipes:
|
||||||
print("<table cellspacing='0'>")
|
print("<p>")
|
||||||
|
print("<table cellspacing='0' border=true>")
|
||||||
|
|
||||||
output_rows = []
|
output_rows = []
|
||||||
|
|
||||||
@ -94,3 +114,9 @@ for sub_recipe in sub_recipes:
|
|||||||
print("</tr>")
|
print("</tr>")
|
||||||
|
|
||||||
print("</table>")
|
print("</table>")
|
||||||
|
print("</p>")
|
||||||
|
|
||||||
|
print("</div>")
|
||||||
|
|
||||||
|
print("</body>")
|
||||||
|
print("</html>")
|
||||||
|
Завантаження…
x
Посилання в новій задачі
Block a user