Rip Print - @rip-lang/print
Syntax-highlighted source code printer
Highlights source code using highlight.js and serves the result in the browser for viewing and printing. Serves once and exits — no leftover files, no cleanup.
Quick Start
# Install
bun add -g @rip-lang/print
# Print all source files in a directory
rip-print src/
# Print specific files
rip-print src/compiler.js src/lexer.js
# Dark theme
rip-print -d src/
# Strip leading comment blocks
rip-print -b src/
# Exclude extensions
rip-print -x lock,map src/
Features
- highlight.js — 190+ languages, beautiful GitHub-style themes
- Auto-detect languages — 40+ languages supported
- Light and dark themes — GitHub Light (default) and GitHub Dark
- Print-optimized CSS — page breaks between files, clean headers
- Table of contents — auto-generated for multi-file output
- Sticky headers — file names stay visible while scrolling
- Serve once — opens browser, serves the page, exits automatically
- No leftover files — everything is in-memory
Options
| Flag | Description |
|---|---|
-b, --bypass |
Strip leading comment blocks from files |
-d, --dark |
Use dark theme (default: light) |
-h, --help |
Show help |
-x <exts> |
Comma list of extensions to exclude |
How It Works
- Walks the specified paths, discovers source files
- Highlights each file using highlight.js with the detected language
- Builds a single HTML page with table of contents
- Starts a Bun server on a random port
- Opens the browser
- Exits after serving the page
Print from the browser with Cmd+P (Mac) or Ctrl+P (Windows/Linux).