cv-builder

CV Builder

A static CV publishing pipeline that:


Repository Structure


High-Level Flow

  1. Data ingest: Airtable records are fetched and normalized into data/cv/<slug>.json.
  2. Render paths:
    • Web viewer (cv.html) renders CV content client-side.
    • Print page (cv-print.html) renders paginated layout client-side.
    • Embed script (cv-embed.js) renders inside Shadow DOM on external sites.
  3. PDF build: scripts/build-cv-pdf.js transforms JSON into print HTML and runs Vivliostyle to generate dist/<slug>.pdf.
  4. AI feedback (optional): workflow/script fetches the triggering CV, sends structured prompt to OpenAI, writes output to Airtable Overall AI Feedback.

Prerequisites

Install dependencies:

npm install

npm Commands

npm run build:json    # Build CV JSON files from Airtable
npm run pdf:build     # Build PDFs from data/cv/*.json
npm run pdf:preview   # Open Vivliostyle preview for cv-print.html
npm run ai:feedback   # Run AI feedback script for the triggering CV

Airtable JSON Build (build:json)

What it does

Trigger targeting logic

The script can resolve a specific CV record ID from:

If configured, it can also build all published CVs.

Environment variables

Required for Airtable access:

Optional/config:

build-cv-json reads footer content from the CV table using CV_Footer (also supports fallback matching), and emits it in JSON as section footer for downstream renderers.


Web Viewer (cv.html)



PDF Build (pdf:build)

What it does

Output

Important notes


Embeddable CV (cv-embed.js)

A non-iframe embed that renders directly in the host page and isolates styles using Shadow DOM.

Basic snippet

<div id="cv-embed-target"></div>
<script
  src="https://cpd4f.github.io/cv-builder/cv-embed.js"
  data-cv="coleman-davis"
  data-target="cv-embed-target"
></script>

Supported data-* attributes

Embed docs page


AI Feedback Automation

Script (scripts/run-cv-ai-feedback.js)

Model

Required environment


GitHub Actions: cv-ai-feedback.yml

Workflow triggers:

Behavior:

  1. Validates guard conditions for issue-triggered runs (title prefix + expected author).
  2. Installs dependencies.
  3. Runs npm run ai:feedback.
  4. Posts success/failure comment back to the triggering issue.

Local Development Checklist

  1. npm install
  2. Configure .env (or export shell vars) for Airtable/OpenAI secrets.
  3. npm run build:json
  4. npm run pdf:build
  5. Serve repository root with any static server and test:
    • /cv?cv=coleman-davis
    • /cv-print.html?cv=coleman-davis
    • /cv-feedback.html?cv=coleman-davis
    • /cv-embed.html

Troubleshooting

npm run pdf:build fails with Playwright download 403

This is typically an environment/network limitation when Vivliostyle tries to fetch Chromium. Re-run in an environment with Playwright download access or preinstalled browser binaries.

Confirm the source Airtable field is CV_Footer on the CVs table and rerun npm run build:json. Footer content is optional and only renders when present.

Triggered workflow ran but nothing updated


Deployment Notes

This repo is designed for static hosting (e.g., GitHub Pages). Ensure the following are published: