feat(docx): native OOXML viewer — fresh start (v2.0.0)#1
Merged
Conversation
Strip all non-docx file types (PDF, PPTX, XLSX) and rebuild the .docx viewer from scratch using direct OOXML parsing (JSZip + DOMParser) instead of HTML conversion. - Parse word/document.xml, styles.xml, numbering.xml, relationships - Render via Obsidian's createEl() — no innerHTML, no React - Resolve full style inheritance chains (basedOn) for paragraph & run properties including numbering definitions from styles - Generate Word numbering text prefixes from lvlText format strings (e.g. "Part 1:", "Step 3:", "a.") with proper counter tracking - Handle structured document tags (w:sdt) for title and content blocks - Force color inheritance via inline styles to prevent Obsidian theme from overriding document text colors on headings and bold elements - Fix boolean property merging (Partial overrides vs style defaults) - Support tables, images, hyperlinks, highlights, breaks, tabs - Strip 7 heavy deps (mammoth, pdfjs, xlsx, etc.) — bundle down to ~117KB - CSS uses only Obsidian variables, via- class prefix throughout Assisted by ClaudeCode
There was a problem hiding this comment.
Pull request overview
Major refactor to make ViewItAll a DOCX-only plugin by introducing a new native OOXML parsing + rendering pipeline and removing the previous PDF/Spreadsheet/PPTX viewers and related utilities.
Changes:
- Added a new
src/docx/engine (model, relationships, numbering, styles parsing, renderer, and parser orchestration). - Simplified plugin entry points/settings/types to focus on DOCX only.
- Removed PDF/Spreadsheet/PPTX viewers and supporting utilities; trimmed CSS and build config accordingly.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| versions.json | Adds v2 version mapping for update compatibility. |
| styles.css | Removes legacy viewer styles; adds DOCX-focused styling. |
| src/views/pdf/pdfTypes.ts | Removes PDF shared types (PDF viewer removed). |
| src/views/pdf/PdfSearchController.ts | Removes PDF search controller (PDF viewer removed). |
| src/views/SpreadsheetView.ts | Removes spreadsheet viewer implementation. |
| src/views/PptxView.ts | Removes PPTX viewer implementation. |
| src/views/PdfView.ts | Removes PDF viewer implementation. |
| src/views/DocxView.ts | Replaces mammoth/html editing pipeline with native OOXML parse+render view and toolbar/zoom. |
| src/utils/xml.ts | Adds OOXML namespace + DOM helper utilities. |
| src/utils/units.ts | Adds unit conversion helpers for OOXML measurements. |
| src/utils/pdfSnap.ts | Removes PDF snapping utility (PDF tooling removed). |
| src/utils/pdfExport.ts | Removes PDF export utility (PDF tooling removed). |
| src/utils/formulaEval.ts | Removes spreadsheet formula evaluator (spreadsheet viewer removed). |
| src/utils/fileUtils.ts | Removes file path helpers used by removed features. |
| src/utils/docxUtils.ts | Removes mammoth/html-to-docx conversion utilities (old DOCX pipeline removed). |
| src/utils/annotations.ts | Removes PDF annotations utilities (PDF tooling removed). |
| src/types.ts | Removes PDF/PPTX/spreadsheet view types and annotation types; keeps DOCX view type. |
| src/settings.ts | Removes non-DOCX settings; keeps DOCX enable/toolbar/zoom settings. |
| src/main.ts | Registers only DOCX view/extension; removes PDF/PPTX/spreadsheet registration logic. |
| src/docx/styles.ts | New OOXML styles parser + inheritance resolver. |
| src/docx/renderer.ts | New DOM renderer for the DOCX document model. |
| src/docx/relationships.ts | New relationships parser for hyperlinks/images/styles/numbering. |
| src/docx/parser.ts | New DOCX parser orchestrating ZIP extraction + model building. |
| src/docx/numbering.ts | New numbering parser for list definitions. |
| src/docx/model.ts | New TypeScript document model definitions for OOXML content. |
| package.json | Bumps to v2, trims dependencies to jszip + obsidian, updates description/scripts. |
| manifest.json | Updates manifest metadata for v2. |
| esbuild.config.mjs | Removes PDF-worker and punycode plugins; simplifies externals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| if (outlineLvlEl) { | ||
| const val = safeParseInt(getVal(outlineLvlEl)); | ||
| if (val !== undefined && val >= 0 && val <= 5) { | ||
| props.headingLevel = val + 1; |
Comment on lines
+538
to
+540
| // Skip cells that are vertically merged continuations | ||
| if (cell.properties.verticalMerge === "continue") { | ||
| // Increment the rowspan of the cell that started this merge |
Comment on lines
+22
to
+36
| import { | ||
| NS_W, | ||
| NS_R, | ||
| NS_WP, | ||
| NS_A, | ||
| NS_PIC, | ||
| getElement, | ||
| getElements, | ||
| getDirectChild, | ||
| getDirectChildren, | ||
| getVal, | ||
| getWAttr, | ||
| getAttr, | ||
| parseXml, | ||
| } from "../utils/xml"; |
| } | ||
|
|
||
| if (children.length === 0) return null; | ||
|
|
| "id": "viewitall", | ||
| "name": "View It All", | ||
| "version": "1.5.0", | ||
| "version": "2.0.1", |
| "version": "2.0.1", | ||
| "minAppVersion": "0.15.0", | ||
| "description": "View and edit MS (.docx - .xlsx - .csv - .pptx ) and more file types directly inside the app — no external apps needed.", | ||
| "description": "View and edit Word documents (.docx) natively in Obsidian.", |
| "version": "1.5.0", | ||
| "description": "Open and edit PDF, Word, Excel, CSV, and PowerPoint files directly inside Obsidian.", | ||
| "version": "2.0.0", | ||
| "description": "View and edit Word documents (.docx) natively in Obsidian.", |
| }); | ||
| setTooltip(zoomLabel, "Reset zoom"); | ||
| zoomLabel.addEventListener("click", () => { | ||
| this.currentZoom = 1.0; |
| "1.4.2": "0.15.0", | ||
| "1.5.0": "0.15.0" | ||
| "1.5.0": "0.15.0", | ||
| "2.0.0": "0.15.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Major refactor introducing native DOCX/OOXML support with a complete architectural overhaul.
Key Changes
New DOCX Engine
src/docx/)Removed Features
Refactoring
Dependencies
Migration
This is a breaking change focusing exclusively on native DOCX document viewing.