From 67836f6481155c9f1046b122780f1be6d1c0d03c Mon Sep 17 00:00:00 2001 From: Jonathan Hendrickson Date: Fri, 28 Jun 2024 20:09:37 -0700 Subject: [PATCH] Add helpful print output and adjust width of page --- docs/Jonathan_Hendrickson_resume.pdf | Bin 54400 -> 54400 bytes docs/index.html | 4 ++-- generator.py | 8 ++++++++ style.css | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/Jonathan_Hendrickson_resume.pdf b/docs/Jonathan_Hendrickson_resume.pdf index 6c3ef5cf60c26ccc2a33a0a9edd5f1055b0e6ced..53ef067ffe76f573b0169b48da4a53af5f852b67 100644 GIT binary patch delta 27 ecmZoz$=tA#c|r%Pv4N$D(ZpUk2xH@h3zq?ZHVMA~ delta 27 ecmZoz$=tA#c|r%Pk*T?X;ly4!2xH@h3zq?Z0|~hR diff --git a/docs/index.html b/docs/index.html index e894cf0..f62c3bd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,13 +4,13 @@ font: 1.1em "Times New Roman", serif; - line-height: 1.5000000000000002; + line-height: 1.5; margin: 40px 0; } #resume { margin: 0 auto; - max-width: 800px; + max-width: 900px; padding: 40px 60px; background: #fff; border: 1px solid #ccc; diff --git a/generator.py b/generator.py index d2d9e2a..ee5be79 100755 --- a/generator.py +++ b/generator.py @@ -197,11 +197,14 @@ def adjust_css(css_content: str, line_height: float) -> str: output_html = os.path.join(output_dir, args.output_html) output_pdf = os.path.join(output_dir, args.output_pdf) + print("Reading input Markdown file...") with open(args.input_md, encoding="utf-8") as mdfp: md_content = mdfp.read() + print("Checking spelling in the Markdown content...") check_spelling(md_content, args.input_dictionary) + print("Reading CSS file...") with open(args.input_css, encoding="utf-8") as cssfp: css_content = cssfp.read() @@ -211,6 +214,8 @@ def adjust_css(css_content: str, line_height: float) -> str: first_iteration = True while True: + line_height = round(line_height, 2) # Round to two decimal places + print(f"Adjusting CSS line height to {line_height}...") adjusted_css = adjust_css(css_content, line_height) html_content = make_html(md_content, adjusted_css) @@ -228,13 +233,16 @@ def adjust_css(css_content: str, line_height: float) -> str: first_iteration = False if num_pages > 1: + print("Content exceeds one page, reverting to previous line height...") # If the content spills over to more than one page, revert to previous settings adjusted_css = adjust_css(css_content, prev_line_height) html_content = make_html(md_content, adjusted_css) + print("Writing HTML content to file with reverted line height...") with open(output_html, "w", encoding="utf-8") as htmlfp: htmlfp.write(html_content) + print("Generating final PDF with reverted line height...") write_pdf(html_content, output_pdf, args.chrome_path) break diff --git a/style.css b/style.css index dcd9711..e70858f 100644 --- a/style.css +++ b/style.css @@ -10,7 +10,7 @@ body { #resume { margin: 0 auto; - max-width: 800px; + max-width: 900px; padding: 40px 60px; background: #fff; border: 1px solid #ccc;