Configures and uses snipgrapher to generate polished code snippet images, including syntax-highlighted PNGs, SVGs, and WebP exports with custom themes, profiles, and styling options. Use when the user wants to create code screenshots, turn code into shareable images, generate pretty code snippets for docs or social posts, produce syntax-highlighted images from source files, or explicitly mentions snipgrapher. Supports single-file renders, batch jobs, watch mode, and reusable named profiles via the snipgrapher CLI or npx.
Use this skill when you need to:
snipgrapher from npm to generate snippet imagesRender a single file to a PNG immediately with no config required:
npx snipgrapher render file.ts -o output.png
For ongoing use, initialise a project config first, then render:
npx snipgrapher init # creates snipgrapher.config.json
npx snipgrapher render file.ts --profile default -o output.png
After rendering, verify the output exists and is non-zero in size before treating the job as successful:
ls -lh output.png # confirm file exists and size > 0
Read these rule files in order:
npxIf a render fails or produces an unexpected output, check for these common causes:
--verbose (if supported) to surface error details, and verify the input file is readable and non-emptynpx snipgrapher init to regenerate snipgrapher.config.json if the config file is missing or malformed