Refactor code structure for improved readability and maintainability

This commit is contained in:
bolade
2025-10-22 01:11:32 +01:00
parent d862577ecf
commit f5d304aec5
13 changed files with 263 additions and 758 deletions
Binary file not shown.
+12 -1
View File
@@ -779,7 +779,18 @@
"execution_count": null,
"id": "fe3b7605",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"4"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
}
],
+12 -3
View File
@@ -38,8 +38,12 @@ page_4_context = {
page_5_context = {
"metabolism_chart": "",
"fuel_source_chart": "",
"metabolism_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/metabolism_chart.png"
),
"fuel_source_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/fuel_source_chart.png"
),
"resting_calories": 1540,
"neat_calories": 310,
"weight_loss_calories": 1725,
@@ -194,7 +198,12 @@ page_11_context = {
}
page_12_context = {
"right_leg": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/right_leg.png"
),
"left_leg": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/left_leg.png"
),
}
page_13_context = {
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 103 KiB

+7 -1
View File
@@ -6,7 +6,12 @@ from context import context_list
env = Environment(loader=FileSystemLoader("report_gen"))
html_pages = []
a = 1
b = "string"
c = [1,2,3,5]
d = {
"key": "value"
}
header_context = {
"patient_name": "Keirstyn Moran",
"age": 34,
@@ -122,3 +127,4 @@ html_string_to_pdf(html_doc, "multi_page_report.pdf")
# pdfkit.from_string(html_doc, "truth_report.pdf", options=options)
print("✅ PDF generated: multi_page_report.pdf")
Binary file not shown.
+230 -751
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -15,7 +15,7 @@
<div class="flex gap-8">
<!-- Chart Image -->
<div class="flex-1">
<img src="right-leg-chart.png" alt="Right Leg SMO2 Chart" class="w-full h-auto">
<img src= "data:image/png;base64,{{ right_leg }}" alt="Right Leg SMO2 Chart" class="w-full h-auto">
</div>
<!-- Right Side Info -->
@@ -48,7 +48,7 @@
<div class="flex gap-8">
<!-- Chart Image -->
<div class="flex-1">
<img src="left-leg-chart.png" alt="Left Leg SMO2 Chart" class="w-full h-auto">
<img src= "data:image/png;base64,{{ left_leg }}" alt="Left Leg SMO2 Chart" class="w-full h-auto">
</div>
<!-- Right Side Info -->