From 311e3b55aa89b402d1dde7d2a212e59d83fc5e05 Mon Sep 17 00:00:00 2001 From: mb Date: Tue, 6 Jun 2023 09:35:20 +0200 Subject: [PATCH] finishing the background-image change from yesterday --- script.py | 27 +++++++++++---------------- style.css | 18 +++++++++--------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/script.py b/script.py index 9cc4bab..d98f4fe 100644 --- a/script.py +++ b/script.py @@ -52,19 +52,17 @@ for folder in materials: md = file.read() card = markdown.markdown(md) #print(card) # the print of all the md files + card = f'
{ card }
' cards[folder][card_folder].append(card) elif my_file.endswith(('.jpg', '.jpeg', '.png')): if 'prototype_' in my_file: my_file= my_file.replace('.jpg', '').replace('.jpeg', '').replace('.png', '').replace('prototype_', '').replace('_', ' ') image_html = f'{my_file}' + f"
{my_file}
" - else: image_html = f'{my_file}' - mycard = f'
{image_html}
' + mycard = f'
{image_html}
' cards[folder][card_folder].append(mycard) - #print(my_file) - - + # print(mycard) #print(card_folder) #print(file_path) @@ -97,22 +95,19 @@ for page in range(number_pages): card_8= choice(cards["4_add_ons"]["make-a-notebook-that"]) cards["4_add_ons"]["make-a-notebook-that"].remove(card_8) - - page_html = f'''
-
{card_1}
-
{card_2}
-
{card_3}
-
{card_4}
-
{card_5}
-
{card_6}
-
{card_7}
-
{card_8}
+ {card_1} + {card_2} + {card_3} + {card_4} + {card_5} + {card_6} + {card_7} + {card_8}
- ''' pages.append(page_html) diff --git a/style.css b/style.css index 575dc1b..aa52d9b 100644 --- a/style.css +++ b/style.css @@ -20,18 +20,18 @@ body{ .card { float: left; - width: calc(210mm / 2 - 10mm); /* Adjusted width to fit 2 cards per row with margins */ - height: calc(297mm / 4 - 10mm); /* Adjusted height to fit 4 rows per page with margins */ - /*border: 1mm solid salmon;*/ - margin: 5mm; + width: calc(210mm / 2); /* Adjusted width to fit 2 cards per row with margins */ + height: calc(297mm / 4); /* Adjusted height to fit 4 rows per page with margins */ + border: 1px solid black; box-sizing: border-box; /* Includes the border in the width and height calculation */ overflow: hidden; - - - - } - +.card.img{ + +} +.card.text{ + padding: 5mm; +} .card.left-card { padding-right: 10mm;