DOCX Viewer
pendingby Gokul & Claude
View .docx files natively; opens in new tab with high-fidelity rendering, pinch-to-zoom, in-document search, auto light/dark theme switch, markdown conversion.
Obsidian DOCX Viewer
View .docx files directly inside Obsidian — in a native tab, just like PDFs.
Features
| Feature | Details |
|---|---|
| 📄 Native tab viewer | Opens .docx in a new tab, same as PDF |
| 🔗 Wikilink support | [[My Document.docx]] opens the viewer |
| 🔍 In-document search | Highlight + navigate all matches |
| 🔎 Zoom | 50%–200%, reset button |
| Print-optimized output | |
| → Convert to Note | Converts to .md alongside the docx |
Installation
Option A — Manual (recommended for development)
- Build the plugin (see Development below)
- Copy the plugin folder into your vault:
<YourVault>/.obsidian/plugins/obsidian-docx-viewer/ ├── main.js ├── manifest.json └── styles.css - In Obsidian: Settings → Community Plugins → Installed Plugins → Enable "DOCX Viewer"
Option B — BRAT (Beta Reviewers Auto-update Tool)
- Install the BRAT plugin from Community Plugins
- Add this repo via BRAT:
BRAT → Add Beta Plugin
Development
Prerequisites
- Node.js 18+
- npm 9+
Setup
git clone <this-repo>
cd obsidian-docx-viewer
npm install
npm run build
This produces main.js in the project root. Copy main.js, manifest.json, and styles.css into your vault's plugin folder.
For live development with auto-rebuild:
npm run dev
Project Structure
src/
main.ts ← Plugin entry point, registers view + file handlers
DocxView.ts ← The viewer tab (ItemView subclass)
converter.ts ← DOCX → Markdown conversion (mammoth.js)
styles.css ← All viewer + toolbar styles
manifest.json ← Obsidian plugin manifest
How It Works
- Rendering: Uses
docx-previewfor high-fidelity rendering (tables, images, fonts, headers, footers). - Conversion: Uses
mammoth.jsto convert DOCX → clean Markdown for the "Convert to Note" feature. - Zoom: CSS
transform: scale()on the rendered document container. - Search: DOM TreeWalker to find text nodes, wraps matches in
<mark>elements, scrolls to current match. - Print: Opens a new window with the rendered HTML + copied stylesheets.
Roadmap (v2)
- Edit and save back to
.docx - Tracked changes display toggle
- Page navigation (jump to page N)
- Thumbnail sidebar
- Annotation / highlight support
Compatibility
- Desktop only (Obsidian mobile does not support Node.js file APIs)
- Obsidian 1.0.0+
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.