惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
爱范儿
爱范儿
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 叶小钗
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
博客园 - 司徒正美
博客园 - 【当耐特】
IT之家
IT之家

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a code snippet beautifier that exports PNG & SVG ...
Bilal Malik · 2026-06-03 · via DEV Community

Bilal Malik

Every developer has been there - you want to share a code snippet on Twitter, a blog post,
or in documentation, and a plain code block just doesn't cut it visually.

So I built SnippitKit. A lightweight tool where you paste your code, pick a theme and font,
tweak the layout, and export a polished PNG or SVG in seconds.

Live at snippitkit.vercel.app - open source, MIT licensed.


Table of Contents

  • The Problem
  • What It Does
  • Export Options
  • My Favourite Detail — JSON-driven Config
  • Tech Stack
  • Run It Locally
  • Contributing

The Problem

Plain code blocks are fine for documentation. But for blog covers, social media posts,
and tutorial screenshots you want something that actually looks good. The popular tools
are either bloated, paywalled, or lock you into their style. I wanted something minimal,
customizable, and fast — so I built it myself.


What It Does

Syntax Highlighting

Powered by Prism.js with autoloading language components. Paste your code, pick a language,
and highlighting applies instantly — no manual setup per language.

Themes & Gradients

Choose from a set of gradient and preset themes to change the background.
Toggle between dark and light modes for different looks. All theme data is JSON-driven
so it's easy to extend.

Google Fonts

Select a font from the picker and it loads dynamically via Google Fonts API.
No bloated font bundles — only the font you pick gets loaded.

Full Layout Control

Adjust padding, border radius, and font size with numeric inputs.
Live preview updates instantly so you see exactly what you'll export.

Accessible UI

Custom select menus with full keyboard support — Arrow keys to navigate,
Enter to select, Escape to close. ARIA labels throughout.


Export Options

Format How
PNG High-quality raster export via dom-to-image-more
SVG Vector export — scales to any size
Copy image Write directly to clipboard (requires HTTPS + browser support)
Copy link Share a link to your current snippet config
Copy code text Double-click the main export button

My Favourite Detail — JSON-driven Config

Themes, fonts, and languages are all driven by JSON data files.
Want to add a new theme? Add an entry to the themes JSON. New language? One line.
No hunting through component logic — the data and the UI are cleanly separated.


Tech Stack

Tool Purpose
HTML5 + CSS3 + JavaScript (ES6+) Core structure, styling, and app logic
Prism.js Syntax highlighting with autoloader
dom-to-image-more PNG / SVG DOM export
Google Fonts Dynamic font loading
Devicons (jsDelivr) Language and tech icons
Vite Dev server and build tooling
Vercel Deployment

Run It Locally

git clone https://github.com/byllzz/snippitkit.git
cd snippitkit
npm install
npm run dev

Open http://localhost:5173.
No environment variables needed - open index.html and you're running.


Contributing

Contributions are welcome. Good first issues:

  • [ ] Add new theme presets to the themes JSON
  • [ ] Add more language entries
  • [ ] Improve SVG export fidelity
  • [ ] Additional font size / padding presets
  • [ ] Accessibility improvements — focus management, screen reader testing
git checkout -b feat/your-feature
# make your changes
git commit -m "feat: your short description"
git push origin feat/your-feature


If SnippitKit saved you from a boring plain code block - a ⭐ on the
GitHub repo means a lot.
Drop feedback in the comments below!