Skip to content

About

Modern, immersive XHTML, HTML, and EPUB live previewer and reader extension for VS Code with dual reading modes, customizable typography, and footnote popovers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

XHTML Reader Previewer Logo

XHTML Reader Previewer

Marketplace Version Open VSX Version GitHub Release Build Status License: MIT VS Code Compatibility

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.

XHTML Reader Previewer Split Preview


🎬 Live Preview & Demo

Experience smooth reading, quick TOC search, and instant typography customization in action:

XHTML Reader Previewer Live Demo

▶️ Watch Full Video Walkthrough (1080p MP4)


📥 Installation

Option 1: Visual Studio Marketplace & Open VSX (Antigravity, Cursor, VSCodium)

  1. Open your IDE's extensions pane (Ctrl+Shift+X / Cmd+Shift+X).
  2. Search for XHTML Reader Previewer (by selvagant).
  3. 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.1.0.vsix

Or via VS Code UI: Extensions View ➔ Click ... (More Actions) ➔ Install from VSIX... ➔ Select the downloaded file.

Option 3: Google Antigravity 2.0 Plugin (Autonomous Auxiliary Pane & MCP)

Install and activate directly as a native Antigravity 2.0 plugin:

npm run deploy:local-plugin

Once deployed to ~/.gemini/config/plugins/xhtml-reader-plugin, Antigravity exposes:

  • Auxiliary Pane Sidecar: Interactive reading panel accessible via pill links [Buka XHTML Reader](sidecar://xhtml-reader-plugin/xhtml-previewer/).
  • MCP Server Tools (xhtml_reader_mcp): Autonomous inspection tools for agents (xhtml_open_preview, xhtml_get_toc, xhtml_get_metadata).
  • Autonomous Reading Rules: Dedicated agent rule guiding AI assistants to preview publications interactively.

✨ 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 (¹, [1], *) to immediately inspect translation notes, citations, and multilingual explanations in an anchored popover with a precise pointer caret—never losing your reading position.
  • ⏪ Reading Navigation History Stack: Seamlessly jump to chapters or references and return instantly using the floating return pill or keyboard shortcuts.
  • 📑 Canonical EPUB Spine Inspector: Dual-tab sidebar (Contents vs Spine Order) adhering strictly to the OPF <spine> sequence with NON-LINEAR badges and rich toolbar metadata.
  • 💾 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
Table of Contents Sidebar Reading Settings Popover

Anchored Footnote & In-line Annotation Popover
Anchored Footnote Popover with Pointer Caret

🚀 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
Editor Title Bar Action Button 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 (‹ / ›)
Return to Previous Position Backspace / B / Alt+Left or Floating Return Pill
Toggle Table of Contents & Spine 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

The repository features a unified Dual-Target Build Pipeline that generates both the VS Code extension and the Antigravity 2.0 plugin from a shared core:

# Install dependencies
npm install

# Type check
npm run check          # Full check
npm run check:core     # Pure core check (verifies zero vscode dependency)

# Run test suite (all 67 unit and integration tests)
npm test

# Build all targets (VS Code extension + Antigravity sidecar & MCP)
npm run build:all

# Target 1: VS Code Extension
npm run build:vscode
npm run package:vsix   # Outputs standalone lean .vsix package

# Target 2: Antigravity 2.0 Plugin
npm run build:plugin   # Builds sidecar-server.cjs & mcp-server.cjs
npm run deploy:local-plugin # Deploys bundle to ~/.gemini/config/plugins/xhtml-reader-plugin

🔒 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.

About

Modern, immersive XHTML, HTML, and EPUB live previewer and reader extension for VS Code with dual reading modes, customizable typography, and footnote popovers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages