Skip to content

feat : Added-svg-generation#47

Open
Avan14 wants to merge 1 commit intogambitproject:mainfrom
Avan14:generate-svg
Open

feat : Added-svg-generation#47
Avan14 wants to merge 1 commit intogambitproject:mainfrom
Avan14:generate-svg

Conversation

@Avan14
Copy link

@Avan14 Avan14 commented Feb 28, 2026

Add generate_svg function

Closes #40

Changes

  • Added generate_svg() to core.py — generates PDF first, then converts to SVG using pdf2svg, Inkscape, or pdftocairo (tried in order)
  • Added --svg flag and --output=*.svg support in commandline()
  • Added --svg CLI handler and help text in cli.py
  • Exported generate_svg in __init__.py
  • Added SVG install instructions and usage examples to README.md
  • Added 6 new tests in test_drawtree.py (4 generation + 2 commandline)
  • Updated Readme

Usage

CLI

draw_tree games/example.ef --svg                # Creates example.svg
draw_tree games/example.ef --output=mygame.svg  # Creates mygame.svg

Python API

from draw_tree import generate_svg
generate_svg('games/example.ef')
generate_svg('games/example.ef', save_to='mygame', scale_factor=0.8)

Tests

All 61 tests in test_drawtree.py pass (6 new + 55 existing).

Note: Submitting this as part of my GSoC 2026 application for Project 2 (GameInterpreter), as suggested in the outreach email.

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