render_diff
Render a git diff as a syntax-highlighted image showing additions in green and deletions in red. Use for sharing code changes or reviewing pull requests.
Instructions
Render a git unified diff as a beautiful syntax-highlighted image (SVG or PNG). Shows additions in green and deletions in red with diff markers.
Perfect for PR reviews, sharing code changes on mobile, or visualising what changed between two versions.
Accepts standard git diff output (unified format). Automatically parses @@ hunk headers and renders additions/deltions with appropriate backgrounds.
The output is SVG by default. Set output_format='png' for a raster image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | Yes | The unified diff content (e.g. output of `git diff` or `git show`). Should include @@ hunk headers and +/- markers. | |
| theme | No | Color theme name | github-dark |
| title | No | Optional title shown in a window title bar | |
| show_line_numbers | No | Show line numbers in the gutter | |
| font_size | No | Font size in pixels | |
| output_format | No | Output format. 'svg' or 'png'. | svg |
| padding | No | Padding around the code block in pixels |