Skip to content

feat: Add cv.output_format to route between html and latex CV generation#397

Open
piscespieces wants to merge 1 commit intosantifer:mainfrom
piscespieces:feat/latex-output-format
Open

feat: Add cv.output_format to route between html and latex CV generation#397
piscespieces wants to merge 1 commit intosantifer:mainfrom
piscespieces:feat/latex-output-format

Conversation

@piscespieces
Copy link
Copy Markdown
Contributor

@piscespieces piscespieces commented Apr 20, 2026

  • 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

What does this PR do?

profile.example.yml gains a cv.output_format setting ("html" default, "latex" opt-in) that auto-pipeline.md reads 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_id under the cv: block for consistency and updates modes/pdf.md to reference the new key path

Related issue

closes #396

Type of change

  • Bug fix
  • New feature
  • Documentation / translation
  • Refactor (no behavior change)

Checklist

  • I have read CONTRIBUTING.md
  • I linked a related issue above (required for features and architecture changes)
  • My PR does not include personal data (CV, email, real names)
  • I ran node test-all.mjs and all tests pass
  • My changes respect the Data Contract (no modifications to user-layer files)
  • My changes align with the project roadmap

Questions? Join the Discord for faster feedback.

Summary by CodeRabbit

  • New Features

    • Added support for selecting CV output format (HTML or LaTeX) in the configuration.
  • Chores

    • Reorganized configuration structure by consolidating CV-related settings under a dedicated section.

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

This PR restructures CV output configuration by introducing a new top-level cv section with an output_format field to control whether CV generation uses HTML→PDF or LaTeX pipelines. It relocates canva_resume_design_id under the cv section and updates the auto-pipeline to conditionally invoke either PDF or LaTeX generation modes based on this setting.

Changes

Cohort / File(s) Summary
Configuration Schema
config/profile.example.yml
Introduced new top-level cv section with output_format field ("html" or "latex"); moved canva_resume_design_id from top-level optional field to nested under cv section.
Pipeline Configuration References
modes/_shared.md
Updated Canva MCP configuration path reference from canva_resume_design_id to cv.canva_resume_design_id to align with restructured config schema.
Auto-pipeline Branching Logic
modes/auto-pipeline.md
Implemented conditional Step 3 (CV generation) logic: executes modes/latex.md when cv.output_format equals "latex", otherwise defaults to modes/pdf.md.
PDF Mode Configuration
modes/pdf.md
Updated Canva resume design ID references from top-level canva_resume_design_id to nested path cv.canva_resume_design_id in conditional checks and Canva export steps.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • #362: Implements the LaTeX export mode and tooling that this PR's conditional branching in auto-pipeline now invokes.

Suggested labels

🔴 core-architecture

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and concisely describes the main feature: adding a cv.output_format configuration to enable routing between HTML and LaTeX CV generation, which is the primary objective.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from issue #396: adds cv.output_format configuration, implements conditional pipeline routing in auto-pipeline.md, and moves canva_resume_design_id under the cv block.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #396 objectives: configuration restructuring, pipeline branching logic, and documentation updates. No extraneous modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 411afb3 and d9abddc.

📒 Files selected for processing (4)
  • config/profile.example.yml
  • modes/_shared.md
  • modes/auto-pipeline.md
  • modes/pdf.md

Comment thread modes/pdf.md
Comment on lines +97 to +101
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cv.output_format config to switch between HTML and LaTeX CV generation

1 participant