19 Nov 2024
Change Log¶
I have been making incremental changes on the site and I think I have now managed to tick a lot of boxes on my wishlist. Key highlights of various changes I have now incorporated on the site are as below:
Nutrition Card¶
The site now presents a nutrition card which includes detailed information on various nutrients not just net-carbs. This is accomplished by sourcing data from UK database, Indian Database, US database, Food Labels and if all that fails then usin the Nutritionix API.
After I did that I was missing the individual contributors to net-carb and also noticed some numbers for net-carbs just felt wrong. This was because of using Nutritionix caused some silly entries because of spelling mistakes in my recipes. So I included another table in nutrition section which also shows net carb contribution per ingredient.
Recipe Template¶
Initially I was generating final markdown and html within the python code and it was becoming a bit unmanageable.
So I removed all that from pythin and included the logic in the jinja2 template named recipe_template.html
.
This really has made a significant difference in maintaining the code and making minor or even major presentation layer improvements such as:
- Steps included in Ingredient List.
- Steps linked to actual steps in steps section.
- Net-carb information in a circular card-- gives
Net Carb
information on recipe right at the top.
Code Cleanup¶
As I was utilising the template, I cleaned up the code further to reduce repeated code and increase reuse of already computed data where possible.
I guess there may still be scope for improvement here but it is much better already. This is evidenced by the amount of code that has been moved into archived_functions.py
.
Multiline and Single line Comments¶
The code is now updated to parse single line comments made with--
and multiline comments that are made by enclosing the lines between [-
and -]
fro any cooklang recipe.
Additionally, these comments are shown as notes on process flow of the recipe.
Although, I am not entriely sure if that is looking great as it squishes the diagram. Granted it can just be zoomed but I am just not sure yet.
Finally, I have also removed the tags cloud from blog entries which is only relevant for recipe section of the site.
Blog Presentation¶
I removed the custom temlpates I had as material for mkdocs now has builtin blog plugin. Just made small overrides to keep the colours etc aligned for the overall site. I am also not a big fan of using some marker for exceprt so I just truncate the blog entry to first 400 words and show a link continue to read on the blog list. Finally, I have also removed the tags cloud from blog entries which is only relevant for recipe section of the site.
To Do¶
- Cleanup and archive files not needed anymore.
- Add some explanation / documentation for parser functions.
- Decide if notes in plantuml should be retained or not.