Skip to content

feat: add --dont-generate-pdf/-nopdf CLI option#491

Closed
franklintra wants to merge 1 commit into
rendercv:mainfrom
franklintra:main
Closed

feat: add --dont-generate-pdf/-nopdf CLI option#491
franklintra wants to merge 1 commit into
rendercv:mainfrom
franklintra:main

Conversation

@franklintra
Copy link
Copy Markdown

@franklintra franklintra commented Sep 1, 2025

Summary

  • Added new command-line switch --dont-generate-pdf (short form: -nopdf) to disable PDF generation
  • The Typst file is still generated, allowing users to use it as an intermediate file for their own processing workflows
  • When PDF generation is disabled, PNG generation is also automatically skipped since PNGs are rendered from the PDF

Motivation

As requested in #481, this feature allows users to skip PDF generation when they only need the intermediate .typ file, similar to the existing -nopng option.

Changes

  • Added dont_generate_pdf field to RenderCommandSettings data model
  • Added CLI option --dont-generate-pdf/-nopdf to the render command
  • Updated run_rendercv_with_printer function to conditionally skip PDF generation
  • Automatically skip PNG generation when PDF is not generated (since PNGs depend on PDF)

Test Plan

  • Tested with --dont-generate-pdf flag - only generates .typ, .md, and .html files
  • Tested with -nopdf short form - works correctly
  • Tested default behavior (no flag) - still generates PDF as expected
  • Verified that PNG generation is automatically skipped when PDF is disabled
  • Fixed ruff linting issues (replaced dictionary key check with dict.get())

Fixes #481

Add new command-line switch to disable PDF generation while still generating
the intermediate Typst file. This allows users to use the .typ output as an
intermediate file for their own processing workflows.

When PDF generation is disabled, PNG generation is also automatically skipped
since PNGs are rendered from the PDF.

Fixes rendercv#481
@thiagowfx
Copy link
Copy Markdown
Contributor

thiagowfx commented Sep 13, 2025

The description of this PR is better, but #482 is more complete (e.g. it updates the JSON schema, this one does not).

Edit: The other PR got merged, this can be closed. Thank you for your contribution either way!

@sinaatalay sinaatalay closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a switch to disable pdf generation

3 participants