README file from
GithubEnglish · 中文
Office Lite Viewer
Preview CSV, XLS/XLSX, DOC/DOCX, JSON and HTML/HTM in Obsidian. Source files stay read-only. Office/JSON previews stay local; HTML scripts and HTTP(S) resources are optional.
- CSV / XLS / XLSX: search, sort, pagination and worksheet tabs. CSV supports UTF-8, UTF-16 and GBK.
- DOC / DOCX: selectable body text with paragraph breaks; no office software required.
- JSON: formatted, selectable text; original numbers and string escapes are preserved.
- HTML / HTM: rendered preview and selectable source, isolated from Obsidian. Full-document language, body styles and script-mode load handlers are preserved. Enable Scripts for trusted buttons, sliders, Canvas and charts; the same switch also permits HTTP(S) scripts, CSS, images, fonts and fetch requests. Web links open outside the preview, while fragment links stay in the document.
- Open a file directly, choose Open in Office Lite Viewer from its menu, or run Office Lite Viewer: Open document.
Install
Community listing · Download ZIP.
For manual installation, extract office-lite-viewer/ into <vault>/.obsidian/plugins/, reload Obsidian and enable Office Lite Viewer.
Embed
```office-lite-viewer
data/budget.xlsx
```
On desktop, choose ⋯ → Open in default app to open the file with its system-associated application.
Limits
- No editing or macro execution. XLS (Excel 97–2003 BIFF8) / XLSX show saved values without recalculating formulas; styles, charts, images and merged-cell layout are not reproduced. Hidden sheets may be shown. Encrypted files are unsupported.
- DOC (Word 97–2003 binary) / DOCX: body text only, up to 2,000,000 characters; no layout, formatting, images, headers/footers, footnotes or comments. Tables become text. Hidden/revised text may appear; this is not a final-revision or redaction viewer. Older DOC, RTF/HTML renamed to DOC and UTF-16 DOCX XML are unsupported. DOCX body XML is limited to 20 MiB expanded and 256 nesting levels.
- Up to 20 MiB per file; spreadsheets: 10,000 rows/sheet, 100 columns, 20 sheets, 500,000 cells/workbook. Search and sort cover loaded data only. Parsing stops after 15 seconds.
- JSON: standard UTF-8 JSON; formatted output up to 40 MiB, indentation capped at 40 levels. CSV encoding can be changed in ⋯ if detection is wrong.
- HTML: UTF-8 only. Document scripts and HTTP(S) resources are OFF by default; Scripts enables both and resets on reload or reopen. A viewer-owned link bridge runs in static mode, but document scripts/handlers remain removed and blocked. Ordinary HTTP(S) anchor clicks open in the host browser without replacing the preview; fragment links stay inside. Only enable scripts for trusted documents; a script can still navigate its own frame directly. Pages cannot access the Obsidian DOM, Node/Electron or localStorage; forms, popups from the document, downloads, embedded frames and top-level navigation remain disabled. Local relative image/CSS/JS files and persistent browser storage are unsupported; remote requests depend on CORS and host restrictions.
- Mobile has not been verified on a device.
Development
Node.js 22+: npm ci → npm run build → npm run package.