Skip to content

Comments

feat: Add generate_svg implementation using pdf2svg#42

Open
Ao-chuba wants to merge 1 commit intogambitproject:mainfrom
Ao-chuba:issue-40-generate-svg
Open

feat: Add generate_svg implementation using pdf2svg#42
Ao-chuba wants to merge 1 commit intogambitproject:mainfrom
Ao-chuba:issue-40-generate-svg

Conversation

@Ao-chuba
Copy link

@Ao-chuba Ao-chuba commented Feb 20, 2026

@edwardchalstrey1 ,
This PR implements the requested generate_svg feature

  • Created the generate_svg function locally inside src/draw_tree/core.py. It mirrors the existing generate_png approach by running
  • generate_pdf first, then utilizing subprocess.run to convert the PDF into a vector SVG format using pdf2svg.
  • Exposed a --svg option to the CLI via cli.py and exported generate_svg as a public module method in init .py.
  • Updated README.md
  • Fixed a minor bug in generate_png where it incorrectly instructed generate_pdf to write the intermediate PDF file to the destination path rather than the requested temporary directory, which was sporadically causing FileNotFoundError during Ghostscript/Imagemagick conversions.
  • Added TestSvgGeneration mapping coverage for defaults, missing files, and uninstalled binaries. Ensured that pytest successfully completes across the test suite locally.

closes #40

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.

[Good first issue]: Add generate_svg function

1 participant