f56763cdfb38c1ba000946693630c696e6d3060e
Remove tracked broken deps symlink and erl_crash.dump, and update dependencies to patched versions: - plug 1.19.1 -> 1.20.3 (fixes CVE-2026-54892, CVE-2026-8468, CVE-2026-56813, CVE-2026-56814) - phoenix 1.8.7 -> 1.8.15 (fixes CVE-2026-56811, CVE-2026-56812) - phoenix_live_view 1.1.30 -> 1.1.33 (fixes CVE-2026-64941) - phoenix_pubsub 2.2.0 -> 2.4.0 - phoenix_template 1.0.4 -> 1.1.0 - plug_crypto 2.1.1 -> 2.2.0 - websock_adapter 0.5.9 -> 0.6.0 mix hex.audit is now clean.
Microprints
Compact visual representations of source code files.
What is a microprint?
A microprint is a compact visual fingerprint where each line of code becomes a colored stripe based on its syntax elements. The result is a small, informative visualization that shows the structure and composition of a file at a glance.
Features
- Syntax-aware colorization — Uses the Erlang/Elixir tokenizer for accurate token classification (functions, strings, comments, atoms, etc.)
- Multi-language support — Works with Elixir, Erlang, and falls back to regex-based detection for other languages
- Indentation-aware — Preserves indentation levels to show nesting structure
- SVG rendering — Phoenix LiveView components for inline SVG visualization
- Caching — ETS-based cache with automatic invalidation via PubSub
- Zero dependencies — Core analysis has no external dependencies
Installation
Add to your mix.exs:
def deps do
[
{:microprints, "~> 0.1"}
]
end
Usage
Generate a microprint
Microprints.generate("path/to/file.ex")
# => {:ok, %{lines: [...], line_count: 42}}
Get color for a syntax type
Microprints.color_for(:function_def)
# => "#EF4444"
Get the color legend
Microprints.color_legend()
# => [{"Function", "#EF4444"}, {"Module", "#EC4899"}, ...]
Render in Phoenix LiveView
<%= live_component @live_view, MicroprintComponent,
microprint: microprint,
width: 200,
max_height: 100,
clickable: true,
file_path: file_path %>
Cache with automatic invalidation
# Start the cache (usually in your dev tools supervision tree)
MicroprintCache.start_link(pubsub: MyApp.PubSub)
# Get or generate
{:ok, microprint} = MicroprintCache.get_microprint("path/to/file.ex")
Color Legend
| Syntax Element | Color |
|---|---|
| Function def | 🔴 Red |
| Module | 🩷 Pink |
| Keyword | 🟣 Purple |
| String | 🟢 Green |
| Comment | ⚫ Gray |
| Atom | 🟠 Amber |
| Number | 🔵 Blue |
| Other | ⚪ Light gray |
Development
cd microprints-git
mix test
License
MIT
Languages
Elixir
100%