How szelenkov/code-djvu works
code-djvu is a read-only VS Code custom editor for local DJVU files. A user opens a .djvu file; the registered editor reads its bytes and passes them to a webview, where the vendored DjVu.js worker decodes pages and supplies rendered images and text status. The webview supports page navigation, page selection, zoom, and basic text detection; editing and saving are not supported. The source excerpts show the editor-to-webview and webview-to-decoder behavior. The README documents the product workflow and capabilities; no separate backend or persistent store is shown.
Main entry points: djvuCustomEditor.ts Custom Editor Provider · djvu.js DjVu.js Worker · extension.ts Extension Activation
Components 8
VS Code Integration
- Extension Activation
src/extension.ts - Custom Editor Provider
src/djvuCustomEditor.ts - Local DJVU File
Viewer Interface
- Viewer Controls
src/djvuCustomEditor.ts
Document Rendering
- DjVu.js Worker
media/djvu.js - Rendered Page
src/djvuCustomEditor.ts
Other components
- User
- VS Code Editor Host
Connections 8
- User → VS Code Editor Host: opens file
README.md - VS Code Editor Host → Custom Editor Provider: routes .djvu
- Extension Activation → Custom Editor Provider: registers
src/extension.ts - Custom Editor Provider → Local DJVU File: reads bytes
src/djvuCustomEditor.ts - Custom Editor Provider → Viewer Controls: posts bytes
src/djvuCustomEditor.ts - Custom Editor Provider → DjVu.js Worker: loads script
src/djvuCustomEditor.ts - Viewer Controls → DjVu.js Worker: decodes and renders
src/djvuCustomEditor.ts - DjVu.js Worker → Rendered Page: provides image
src/djvuCustomEditor.ts