A modern, immersive, and feature-rich XHTML, HTML, and EPUB reader and live previewer extension for VS Code and compatible IDEs (Antigravity, Cursor, VSCodium).
Whether you are authoring ebooks, inspecting XHTML documents, or reading .epub files directly inside your editor, XHTML Reader Previewer provides a distraction-free, beautifully crafted reading experience with dual reading modes, customizable typography, and instant footnote inspection.
🎬 Live Preview & Demo
Experience smooth reading, quick TOC search, and instant typography customization in action:
▶️ Watch Full Video Walkthrough (1080p MP4)
📥 Installation
Option 1: Visual Studio Marketplace & Open VSX (Antigravity, Cursor, VSCodium)
- Open your IDE's extensions pane (
Ctrl+Shift+X / Cmd+Shift+X).
- Search for
XHTML Reader Previewer (by selvagant).
- Click Install.
Or install directly via CLI:
code --install-extension selvagant.xhtml-reader-previewer
Option 2: Direct VSIX Download (GitHub Release)
Download the standalone .vsix installer from the Latest GitHub Release.
To install manually:
code --install-extension xhtml-reader-previewer-0.0.3.vsix
Or via VS Code UI: Extensions View ➔ Click ... (More Actions) ➔ Install from VSIX... ➔ Select the downloaded file.
✨ Key Features
- 📖 EPUB Archive Support (
.epub): Open binary .epub archives directly with zero manual extraction. Works seamlessly as a Custom Editor or through preview commands.
- 📁 EPUB Folder Package Support: Full parsing of extracted EPUB 3 folder packages (
package.opf, nav doc, NCX, and spine sequence).
- 🔄 Dual Reading Modes:
- Continuous Scroll: Smooth web-like reading with natural overscroll resistance and gesture-based chapter transitions (Moon+ Reader style).
- Paginated Reader: Clean multi-column book layout with page navigation and smooth pagination.
- 🧭 Table of Contents (TOC) Sidebar: Slide-over drawer with hierarchical navigation and live search filtering.
- 🎨 Customizable Typography & Themes:
- Themes: Dark, Light, and Sepia
- Font families: Serif, Sans-Serif, and Monospace
- Adjust font sizes, line heights, and reading column widths on the fly.
- 📌 Anchored Footnote & Noteref Popovers: Hover or click footnote references to read notes without losing your reading position.
- 💾 Reading Location Persistence: Automatically remembers your exact reading progress, scroll offset, and last opened chapter per book across sessions.
- ⚡ Ultra-Compact Immersive UI: Floating, auto-collapsing toolbar with official Phosphor icons and ghost aesthetics.
🖼️ Feature Highlights
| Table of Contents (TOC) Sidebar |
Typography & Theme Customization |
 |
 |
🚀 Usage
Preview Active File
Right-click any .xhtml, .html, .htm, or .epub file in the Explorer, or click the preview button in the editor title bar:
XHTML Reader: Open Preview
XHTML Reader: Open Split Preview
| Editor Title Bar Quick Action |
Explorer Context Menu |
 |
 |
Custom Editor Integration
Double-click any .epub file in your workspace to open it immediately in the dedicated reader view.
⌨️ Shortcuts & Navigation
| Action |
Shortcut / Gesture |
| Next / Previous Page (Paginated) |
→ / ← or PageDown / PageUp |
| Next / Previous Chapter |
] / [ or Header Navigation Buttons (‹ / ›) |
| Toggle Table of Contents |
T or Click Contents Button |
| Quick Search TOC |
/ (focuses TOC search input) |
| Open Settings |
S or Click Settings Icon |
| Natural Chapter Scroll Transition |
Scroll past top/bottom boundaries (Overscroll) |
🛠️ Development & Building
# Install dependencies
npm install
# Type check
npm run check
# Run unit tests
npm test
# Build extension bundles
npm run build
# Package local VSIX
npx @vscode/vsce package
🔒 Security & Privacy
- Local Execution: No telemetry, no external network requests, zero remote scripts.
- Strict Content Security Policy (CSP): Dynamic HTML is safely rendered with nonces and sandbox isolation.
- Resource Protection: Path traversal checks and ZIP bomb prevention built into the archive reader.
📄 License
Distributed under the MIT License.
Copyright (c) 2026 selvagant.