")
+ exit(1)
+
+recipe_dir = argv[1]
+
+recipe_names = {}
+for dirpath, dirnames, filenames in walk(recipe_dir):
+ for filename in filenames:
+ if filename.endswith("json"):
+ recipe = Recipe(path.join(dirpath, filename))
+
+ html = recipe.to_html()
+ html_filepath = path.join(dirpath, f"{filename.rsplit('.', maxsplit=1)[0]}.html")
+
+ with open(html_filepath, 'w') as html_file:
+ html_file.write(html)
+
+ recipe_names[recipe.name] = path.relpath(html_filepath, start=recipe_dir)
+
+index_html = f"""
+
+
+Recipes
+
+
+
+
+
+
+
+
+
+{"\n".join([f" - {name}
" for name, filepath in recipe_names.items()])}
+
+
+
+
+
+"""
+
+with open(path.join(recipe_dir, "index.html"), 'w') as index_file:
+ index_file.write(index_html)
+