-
Notifications
You must be signed in to change notification settings - Fork 0
feat-v2.0: PDF Export Support #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements jobsnap export command to generate PDF or HTML from saved jobs. Features: - PDF generation using Puppeteer (optional dependency) - HTML export fallback when Puppeteer not available - Smart .md file detection (works with custom template names) - Clean metadata output (strips YAML frontmatter and duplicates) - Single-line metadata header with consistent date formatting - Index.jsonl tracking with has_pdf flag - Professional styling with print-optimized CSS Usage: jobsnap export <job_dir> # Generate PDF (default) jobsnap export <job_dir> --format html # Generate HTML Closes #5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds client-side PDF generation to browser extension using html2pdf.js. Features: - Format selector in popup (Markdown/PDF) - Client-side PDF generation with html2pdf.js library - Same styling and metadata as CLI export - Works from current tab or pasted URL - No server required - all processing in browser Changes: - Added html2pdf.js (minified third-party library) - Created core/exportPdf.js for PDF generation logic - Updated popup UI with format radio buttons - Updated popup.js to handle PDF downloads - Added .eslintignore to exclude minified files - Updated lint-staged config to skip .min.js files Usage: 1. Select "PDF" format in extension popup 2. Click "Download from current tab" or paste URL 3. PDF downloads automatically Related to #5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Date format changes: - Change all user-facing dates from ambiguous numeric format (1/2/2026) to unambiguous month-name format (Jan 02, 2026) - Prevents confusion between DD/MM/YYYY and MM/DD/YYYY - Applies to CLI export, CLI list, and extension PDF export - Original markdown content preserves scraped dates unchanged Metadata layout fixes: - Fix issue where long company names caused "Published" date to be cut off at page edge - Display Job ID and Company on separate lines - Add line-height: 1.8 for better spacing - Add word-wrap and overflow-wrap for long text - Keep dates (Saved, Deadline, Published) on same line 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implement chrome.tabs.printToPDF for Chrome/Edge users to generate high-quality vector PDFs (~200KB) matching CLI output. Falls back to html2pdf.js for Firefox/Safari (~400KB). Implementation: - New service worker (background.js) handles printToPDF requests - Browser detection routes to appropriate PDF generator - Progressive enhancement: 80% users get perfect quality - Export generateJobHTML + stripMetadata from exportPdf.js Results: - Chrome/Edge: 363KB vector PDF (vs CLI 197KB) - Firefox/Safari: 400KB raster PDF (html2pdf.js fallback) - Previous html2pdf-only: 728KB raster PDF - 50% file size reduction while improving quality Also fixes: - Blank PDF issue (proper DOMParser HTML rendering) - UI: move format selector above download button 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move Puppeteer from optionalDependencies to dependencies to ensure PDF export functionality is always available. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add PUPPETEER_SKIP_DOWNLOAD env var to workflows since: - Current tests don't require Puppeteer/Chrome - Saves ~300MB download and 30-60s build time per run - Puppeteer still required for local PDF generation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add .eslintignore file to exclude third-party minified libraries from ESLint checks. Fixes CI lint failures caused by html2pdf.bundle.min.js. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PDF Export Support for JobSnap v2.0
Overview
Adds comprehensive PDF export functionality to both CLI and browser extension, with intelligent browser-specific optimization for best quality and file size. Includes date format standardization, improved PDF layout, and CI optimizations.
Features
🖨️ CLI PDF/HTML Export
has_pdf: true)Usage:
🌐 Extension PDF Export
chrome.tabs.printToPDF(~363KB)📅 Date Format Standardization
1/2/2026)Jan 02, 2026(MMM DD, YYYY)🎨 Improved PDF Layout
line-height: 1.8Technical Implementation
CLI Export Command
index.jsonlwithhas_pdfmetadataExtension Architecture
Dual PDF Generation Strategy:
Native Path (Chrome/Edge - 80% of users):
background.js) handleschrome.tabs.printToPDFrequestsFallback Path (Firefox/Safari - 20% of users):
Browser Detection:
Shared HTML Template
generateJobHTML()andstripMetadata()for reuseFile Size Comparison
Improvement: 50% file size reduction + quality improvement for 80% of users
Dependencies
Added
^24.34.0) - Required dependency for CLI PDF exportBundled (Extension)
v0.10.1) - Bundled as static file (885KB)CI/CD Changes
GitHub Actions Optimization
Updated workflows to skip Puppeteer Chrome download in CI:
Benefits:
Files updated:
.github/workflows/test.yml.github/workflows/lint.ymlTesting
UI Changes
Extension Popup
PDF Output
Header metadata layout:
Migration Notes
npm installnow includes Puppeteer automaticallyCommits
a1dede8- feat(extension): add PDF download supporte3500bb- feat(pdf): improve date format and metadata layoute6feafe- feat(extension): add native PDF generation for Chrome/Edgeefa2cac- chore: make Puppeteer a required dependency70a850b- ci: skip Puppeteer Chrome download in CIBreaking Changes
None. Fully backward compatible with v1.0.
Checklist
npm test)npm run lint)Documentation Updates Needed (Follow-up PR)
exportcommandexportcommandFuture Enhancements