API Reference
CV generator
CV generator: convert a Markdown CV into a single-page, ATS-friendly PDF.
The input Markdown file and output PDF file are configured in a .env file in the current working directory:
MARKDOWN_FILE_URL=”cv.md” PDF_OUTPUT_LOCATION=”cv.pdf”
Experience headings may use ### Role / Company | Dates. The text before
the final pipe is aligned left, while the dates are aligned right.
- class scripts.cv_generator.RenderProfile(body_font_size, body_line_height, h1_font_size, spacing_scale)[source]
Bases:
objectTypography and spacing values for one deterministic render attempt.
-
body_font_size:
float
-
body_line_height:
float
-
h1_font_size:
float
-
spacing_scale:
float
-
body_font_size:
- scripts.cv_generator.css_for_profile(profile)[source]
Return the CV stylesheet configured for a render profile.
- Return type:
str
- class scripts.cv_generator.ExperienceHeaderTreeprocessor(md=None)[source]
Bases:
TreeprocessorTurn level-three headings into two-column experience headers.
- class scripts.cv_generator.ExperienceHeaderExtension(**kwargs)[source]
Bases:
ExtensionRegister the CV experience-heading transformation.
- scripts.cv_generator.load_environment(env_file)[source]
Load an environment file using standard python-dotenv semantics.
Existing environment variables take precedence over values in the file.
- Return type:
None
- scripts.cv_generator.required_setting(name)[source]
Return a required environment setting or raise a clear error.
- Return type:
str
- scripts.cv_generator.local_path(value, base_directory)[source]
Resolve a local path or file URL relative to the working directory.
- Return type:
Path
- scripts.cv_generator.markdown_to_html(markdown_text, profile=RenderProfile(body_font_size=10.0, body_line_height=1.45, h1_font_size=19.0, spacing_scale=1.0))[source]
Convert Markdown source to a complete HTML document.
- Return type:
str
- scripts.cv_generator.generate_pdf(source, destination)[source]
Render one Markdown file as a single-page A4 PDF atomically.
- Return type:
None
Website screenshots
Website screenshot: capture one 1600x900 desktop JPEG per configured site.
The site list and the output directory are configured in a .env file in the current working directory:
SCREENSHOT_SITES=”https://example.com,https://example.org” SCREENSHOT_OUTPUT_DIR=”/home/your-username/Pictures”
SCREENSHOT_SITES is a comma-separated list of http/https URLs and is
required. SCREENSHOT_OUTPUT_DIR is optional and defaults to ~/Pictures;
the directory is created when absent.
Each site is captured in a fresh Chromium context sized to a 1600x900 viewport
at scale factor 1, and the visible viewport is written as
<hostname>.jpg, overwriting the file from the previous run. GitHub Pages
project sites are named after the repository instead of the shared user
hostname, with underscores replaced by hyphens, so
https://username.github.io/my_project/ is written as my-project.jpg.
- scripts.screenshot.load_environment(env_file)[source]
Load an environment file using standard python-dotenv semantics.
Existing environment variables take precedence over values in the file.
- Return type:
None
- scripts.screenshot.required_setting(name)[source]
Return a required environment setting or raise a clear error.
- Return type:
str
- scripts.screenshot.default_output_directory()[source]
Return the screenshot directory used when none is configured.
- Return type:
Path
- scripts.screenshot.parse_sites(value)[source]
Return the validated website URLs listed in a comma-separated value.
- Return type:
list[str]
- scripts.screenshot.load_config()[source]
Return the configured sites and the prepared output directory.
- Return type:
tuple[list[str],Path]
- scripts.screenshot.hostname_to_filename(url)[source]
Return the .jpg filename for a website URL.
The hostname names the file, except on GitHub Pages project sites, where every project shares one <username>.github.io hostname; those are named after the first path segment (the repository) instead, with underscores replaced by hyphens.
- Return type:
str
- Args:
url: The website URL to derive a filename from.
- Returns:
The filename to write the screenshot to.
- Raises:
ValueError: If the URL carries no hostname.
- scripts.screenshot.hide_cookie_banners(page)[source]
Remove known cookie-banner elements, ignoring selectors that fail.
- Return type:
None
- scripts.screenshot.capture_website(browser, url, output_directory)[source]
Capture one website as a 1600x900 JPEG in the output directory.
- Return type:
None