Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 1.23 KB

python-code-image.docs.md

File metadata and controls

5 lines (3 loc) · 1.23 KB

Create PNG images of Python code with live syntax highlighting and a macOS-style window frame. Choose GitHub dark, GitHub light, Flexoki Dark or Flexoki Light, edit the window filename, adjust font size, outer padding and background colour (or keep the default transparent background), and optionally include line numbers. Images automatically fit the code without wrapping and export at 2× resolution. Code stays in your browser.

Syntax highlighting uses highlight.js 11.12.0 for both the editor and PNG renderer, including Python template strings and the sentinel and frozendict built-ins. GitHub dark and light colours come from the official github-dark.min.css and github.min.css themes. Custom Flexoki Dark and Light themes use Steph Ango's official Flexoki palette, with 400 accents for dark and 600 accents for light. The same theme colours are used for the editor, window frame, line numbers and PNG export. CodeMirror 6 provides editing and keyboard shortcuts; dependencies load from pinned CDNs.

The area around the editor frame is transparent by default. A preview-only checkerboard indicates transparency; the editor frame keeps its theme background. Uncheck Transparent background to use a solid background colour.