tingke137 downloadsInsert and preview any file type (Word, Excel, PowerPoint, HTML) in notes, with a file card fallback.
English | 中文
An Obsidian plugin to insert and preview any file type inside your notes — Word, Excel, PowerPoint, HTML, CSV and more. Unsupported formats get a neat file card that opens with the system default app.
Package name
obsidian-any-viewer, plugin IDany-viewer.
| Format | Rendering |
|---|---|
.docx |
High-fidelity rendering (styles, page breaks, headers/footers) via docx-preview |
.xlsx .xlsm |
Real cell styling: fills (incl. theme colors & tint), fonts, borders, alignment, merged cells, column widths, row heights, number formats via exceljs |
.xls .csv .tsv |
Table rendering with sheet tabs via SheetJS |
.pptx |
Slide rendering (great for image-based decks) via pptx-preview |
.html .htm |
Sandboxed iframe (srcdoc with inlined stylesheets; script execution configurable) |
Any other type Obsidian doesn't natively render (.zip, .exe, .psd, .sketch, …) becomes a file card: type icon + filename + size.
Images, audio, video, PDF, Markdown and Canvas are rendered by Obsidian itself.
Any Viewer: 插入本地文件(任意类型), or click the paperclip ribbon iconCtrl/Cmd+V, or drag & drop it into the editor![[file]] embed is inserted at the cursor; name conflicts are auto-numberedWrite ![[filename.ext]] in a note to preview it inline:
| Syntax | Effect |
|---|---|
![[report.xlsx]] |
Default size (full width, default height from settings) |
![[report.xlsx|300]] |
Card sized to 300px wide; content keeps natural size and scrolls inside |
![[doc.docx|x400]] |
Height only: 400px tall |
![[doc.docx|300x400]] |
300px wide + 400px tall |
Pick which part of the file to show — combines freely with the sizing syntax
(fragment before the \|, size after):
| Syntax | Effect |
|---|---|
![[deck.pptx#page=3]] |
Only slide 3 (single page ≡ 3~3) |
![[deck.pptx#page=3~10]] |
Slides 3–10, stacked (3~ = to the last slide) |
![[doc.docx#page=2]] |
Only page 2 (same range forms as pptx) |
![[book.xlsx#Sheet2]] |
Start on the named worksheet (tab bar stays) |
![[book.xlsx#A1:D10]] |
Only that cell range |
![[book.xlsx#Sheet2!A1:D10]] |
Named worksheet + range |
![[book.xlsx#5:20]] |
Only rows 5–20 |
![[page.html#header]] |
Scroll to the element with that id |
Range rules: - works like ~; reversed ranges normalize automatically
(8~3 → 3~8); the end clamps to the last page; an out-of-bounds start falls
back to the whole file. The embed header shows a badge ("Pages 3–10").
Fragments scope the inline embed only (a worksheet/range fragment hides
the sheet tab bar) — opening the file in a tab shows the whole document and
auto-scrolls to the fragment position (like Obsidian's native PDF embeds).
Embeds have a header bar: click the filename or double-click the content to open the file in a tab; header buttons open a tab or the system app.
Clicking .docx/.xlsx/.xls/.csv/.tsv/.pptx/.html/.htm files in the explorer opens them in a full-height preview pane.
main.js, styles.css, manifest.json from the latest release<your vault>/.obsidian/plugins/any-viewer/BRAT → Add Plugin → paste this repository's Git URL.
.html files inside a sandboxed iframe. If such a file itself references external URLs (CDN fonts / scripts / images), those assets are loaded by the embedded page — governed by Obsidian's CSP and the "Allow scripts in HTML" setting (on by default, can be turned off).npm install
npm run build # produces main.js
.doc, .ppt) can't be previewed inline (file card instead); they still open with the system app<script src> may be blocked by Obsidian's CSP; inline scripts run fine.pptx preview is static — animations and media don't play