Skip to content

HuanLinOTO/dsh-plugin-better-sidebar-plugin-office

120Last commit Aug 15, 2026

dsh-plugin-better-sidebar-plugin-office DSH plugin

This plugin separates the Office rendering libraries (docx-preview, Univer/SheetJS, pptx-renderer) from the better-sidebar main bundle, reducing its compressed size by about 2.2MB. It registers three file viewers that replace the built-in ones, providing identical behavior and settings integration.

How to install the dsh-plugin-better-sidebar-plugin-office DSH plugin

dsh plugin --profile web add @huanlin/dsh-plugin-better-sidebar-plugin-office

Copying does not run this command. Review the repository and version before installing the dsh-plugin-better-sidebar-plugin-office DSH plugin.

dsh-plugin-better-sidebar-plugin-office DSH plugin data source

dsh-plugin-better-sidebar-plugin-office DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-plugin-better-sidebar-plugin-office DSH plugin can do

  • Registers a docx viewer using docx-preview with fidelity rendering including styles, images, tables, and Alt+scroll zoom.
  • Registers an xlsx viewer using Univer sheets preset supporting data, formulas, merged cells, column width/row height.
  • Registers a pptx viewer using @aiden0z/pptx-renderer with native browser preview and page navigation.
  • Viewer descriptors match the original built-in ones exactly, so file routing, priority, and side card settings work automatically.
  • Client components are self-contained with built-in locale (Chinese/English) and CSS.
  • Falls back to a 'Download to view' link on rendering failure.

Where the dsh-plugin-better-sidebar-plugin-office DSH plugin fits

  • Preview Word documents directly in the better-sidebar file explorer.
  • View Excel spreadsheets with formulas and merged cells without leaving the sidebar.
  • Browse PowerPoint presentations with page navigation in the sidebar.
  • Disable individual Office previewers from the side card settings panel if needed.
  • Reduce the main better-sidebar bundle size by loading Office rendering only when needed.

Who the dsh-plugin-better-sidebar-plugin-office DSH plugin is for

  • Users of DSH web who have the better-sidebar plugin installed and need Office file preview.
  • Developers who want to keep the DSH profile lean and only add Office preview on demand.

dsh-plugin-better-sidebar-plugin-office DSH plugin limitations

  • Requires better-sidebar >= 0.6.0; older versions have built-in viewers that cause registration conflicts.
  • Only works within the DSH web environment as an extension of the better-sidebar plugin.
  • Client bundle may contain dependencies like jszip and xlsx; must verify absence of Node builtin references after build.

dsh-plugin-better-sidebar-plugin-office DSH plugin: from the repository README

Quoted from the HuanLinOTO/dsh-plugin-better-sidebar-plugin-office README, the upstream source of the dsh-plugin-better-sidebar-plugin-office DSH plugin. Copyright remains with the original authors.

> 📌 本插件已收录于 [dshfind](https://dshfind.com/zh) 插件超市,点击上方徽章直达主页。 # dsh-better-sidebar-plugin-office [![npm version](https://img.shields.io/npm/v/@huanlin/dsh-plugin-better-sidebar-plugin-office)](https://www.npmjs.com/package/@huanlin/dsh-plugin-better-sidebar-plugin-office) DSH web 插件:为 better-sidebar 的编辑器提供 Office 三件套文件预览(`.docx` / `.xlsx` / `.pptx`)。 ## 背景 better-sidebar 曾内置这三个 viewer,但 docx-preview / Univer(+ SheetJS)/ pptx-renderer 会把 client bundle 撑到约 23MB。本插件把它们拆成独立 bundle,better-sidebar 本体不再内联 Office 渲染库(约 5.9MB 全套 → 2.2MB 压缩),需要 Office 预览的用户单独安装本插件即可。 ## 功能 - 通过 `ctx.betterSidebar.registerFileViewer` 注册 3 个 viewer(id 与内置一致): - `docx`:`.docx`,docx-preview 保真渲染(样式/图片/表格,Alt+滚轮缩放) - `xlsx`:`.xlsx`,Univer sheets 预设(数据 + 公式 + 合并单元格 + 列宽/行高) - `pptx`:`.pptx`,@aiden0z/pptx-renderer 浏览器原生预览(翻页导航) - viewer 描述符形状与原内置完全一致(`mediaUrl` 策略、priority 0、title/icon),因此: - 既有文件路由行为不变(扩展名匹配优先于 binary-download / code 兜底) - Side card 设置页自动显示这三个 viewer 的启用开关 - 加载/渲染失败回退到「下载查看」链接 - 客户端组件自包含:自带 locale(中/英)与 CSS,不依赖 better-sidebar 的 client 内部实现 ## 依赖 better-sidebar 版本 需要 better-sidebar `>= 0.6.0`(已移除内置 office viewer 的版本),否则会与内置 `docx/xlsx/pptx` 注册冲突(`already registered`)。 ## 开发

Read the full READMERepository license: NOASSERTION

dsh-plugin-better-sidebar-plugin-office DSH plugin questions

How do I install this plugin?

Run `dsh plugin --profile web add @huanlin/dsh-plugin-better-sidebar-plugin-office` in your terminal. Then restart the `dsh web` process and hard refresh your browser (Ctrl+Shift+R).

Which file formats are supported?

The plugin supports .docx (Word), .xlsx (Excel), and .pptx (PowerPoint) files. These are the three most common Office document formats.

What version of better-sidebar do I need?

You need better-sidebar version 0.6.0 or higher. Older versions have built-in Office viewers that will cause an 'already registered' error when this plugin tries to register its viewers.

Can I disable a specific previewer?

Yes. Open the side card settings panel, go to the 'File Preview' section, and you'll see three cards for docx, xlsx, and pptx. You can toggle each one on or off independently.

What happens if rendering fails?

If a file fails to render (e.g., due to corruption or unsupported features), the plugin shows a 'Download to view' link. You can then download the file and open it with a desktop Office application.