feat: Add cv.output_format to route between html and latex CV generation#397
feat: Add cv.output_format to route between html and latex CV generation#397piscespieces wants to merge 1 commit intosantifer:mainfrom
cv.output_format to route between html and latex CV generation#397Conversation
- Adds cv.output_format to profile.example.yml (html default, latex opt-in). - auto-pipeline.md reads the setting and branches to modes/pdf.md or modes/latex.md. - Moves canva_resume_design_id under the cv: block for consistency and updates modes/pdf.md to reference the new key path
📝 WalkthroughWalkthroughThis PR restructures CV output configuration by introducing a new top-level Changes
Sequence DiagramsequenceDiagram
participant User
participant AutoPipeline as auto-pipeline.md
participant Config as config/profile.yml
participant PDFMode as modes/pdf.md
participant LaTeXMode as modes/latex.md
participant Canva as Canva Export
User->>AutoPipeline: Step 3: Generate CV
AutoPipeline->>Config: Read cv.output_format
Config-->>AutoPipeline: output_format value
alt output_format == "latex"
AutoPipeline->>LaTeXMode: Execute LaTeX pipeline
LaTeXMode-->>User: LaTeX-generated CV
else default (html)
AutoPipeline->>PDFMode: Execute PDF pipeline
PDFMode->>Config: Read cv.canva_resume_design_id
Config-->>PDFMode: Canva design ID
PDFMode->>Canva: Export design (if ID present)
Canva-->>PDFMode: Download URL
PDFMode->>PDFMode: Generate HTML→PDF via Playwright
PDFMode-->>User: PDF-generated CV
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@modes/pdf.md`:
- Around line 97-101: The PDF generation prompt must preserve legacy Canva
config by checking cv.canva_resume_design_id first and then falling back to the
old top-level canva_resume_design_id; update the logic that decides whether to
show the two-choice prompt so it reads cv.canva_resume_design_id, and if absent
but canva_resume_design_id exists treat it as a non-destructive legacy value
(display a migration note / informational message about moving to
cv.canva_resume_design_id) before proceeding to skip the prompt or use the
HTML/PDF flow; reference the keys cv.canva_resume_design_id and
canva_resume_design_id and the prompt behavior described in modes/pdf.md when
making this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8e8b09f5-e994-4434-827b-7f0ec4fb29d8
📒 Files selected for processing (4)
config/profile.example.ymlmodes/_shared.mdmodes/auto-pipeline.mdmodes/pdf.md
| If `config/profile.yml` has `cv.canva_resume_design_id` set, offer the user a choice before generating: | ||
| - **"HTML/PDF (fast, ATS-optimized)"** — existing flow above | ||
| - **"Canva CV (visual, design-preserving)"** — new flow below | ||
|
|
||
| If the user has no `canva_resume_design_id`, skip this prompt and use the HTML/PDF flow. | ||
| If the user has no `cv.canva_resume_design_id`, skip this prompt and use the HTML/PDF flow. |
There was a problem hiding this comment.
Preserve legacy Canva config during the key move.
Existing config/profile.yml files are user-owned and will not be auto-migrated, so users with the old top-level canva_resume_design_id will silently lose the Canva flow. Check cv.canva_resume_design_id first, then fall back to canva_resume_design_id with a migration note before skipping the prompt.
Proposed wording update
-If `config/profile.yml` has `cv.canva_resume_design_id` set, offer the user a choice before generating:
+If `config/profile.yml` has `cv.canva_resume_design_id` set, offer the user a choice before generating.
+For backward compatibility, if only the legacy top-level `canva_resume_design_id` exists, use it for this run and tell the user to move it under `cv.canva_resume_design_id`.
- **"HTML/PDF (fast, ATS-optimized)"** — existing flow above
- **"Canva CV (visual, design-preserving)"** — new flow below
-If the user has no `cv.canva_resume_design_id`, skip this prompt and use the HTML/PDF flow.
+If neither `cv.canva_resume_design_id` nor legacy `canva_resume_design_id` is set, skip this prompt and use the HTML/PDF flow.Based on learnings, “Keep user-specific data in the User Layer (cv.md, config/profile.yml, modes/_profile.md, article-digest.md, portals.yml, data/, reports/, output/, interview-prep/) which is never auto-updated”.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| If `config/profile.yml` has `cv.canva_resume_design_id` set, offer the user a choice before generating: | |
| - **"HTML/PDF (fast, ATS-optimized)"** — existing flow above | |
| - **"Canva CV (visual, design-preserving)"** — new flow below | |
| If the user has no `canva_resume_design_id`, skip this prompt and use the HTML/PDF flow. | |
| If the user has no `cv.canva_resume_design_id`, skip this prompt and use the HTML/PDF flow. | |
| If `config/profile.yml` has `cv.canva_resume_design_id` set, offer the user a choice before generating. | |
| For backward compatibility, if only the legacy top-level `canva_resume_design_id` exists, use it for this run and tell the user to move it under `cv.canva_resume_design_id`. | |
| - **"HTML/PDF (fast, ATS-optimized)"** — existing flow above | |
| - **"Canva CV (visual, design-preserving)"** — new flow below | |
| If neither `cv.canva_resume_design_id` nor legacy `canva_resume_design_id` is set, skip this prompt and use the HTML/PDF flow. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@modes/pdf.md` around lines 97 - 101, The PDF generation prompt must preserve
legacy Canva config by checking cv.canva_resume_design_id first and then falling
back to the old top-level canva_resume_design_id; update the logic that decides
whether to show the two-choice prompt so it reads cv.canva_resume_design_id, and
if absent but canva_resume_design_id exists treat it as a non-destructive legacy
value (display a migration note / informational message about moving to
cv.canva_resume_design_id) before proceeding to skip the prompt or use the
HTML/PDF flow; reference the keys cv.canva_resume_design_id and
canva_resume_design_id and the prompt behavior described in modes/pdf.md when
making this change.
What does this PR do?
profile.example.ymlgains acv.output_formatsetting ("html" default, "latex" opt-in) thatauto-pipeline.mdreads at Step 3 to branch between the Playwright HTML→PDF flow and the LaTeX engine flow.Users can now get LaTeX-compiled CVs as part of the standard evaluate→report→PDF pipeline without any manual steps. Also relocates
canva_resume_design_idunder thecv:block for consistency and updatesmodes/pdf.mdto reference the new key pathRelated issue
closes #396
Type of change
Checklist
node test-all.mjsand all tests passQuestions? Join the Discord for faster feedback.
Summary by CodeRabbit
New Features
Chores