返回目录

dsh-plugin-better-sidebar-plugin-office

编辑精选维护状态: 活跃

huanlinoto/dsh-plugin-better-sidebar-plugin-office

为 better-sidebar 提供 Office 三件套预览(.docx/.xlsx/.pptx),独立 bundle 瘦身主体 | Provides Office-suite preview (.docx/.xlsx/.pptx) for better-sidebar as a separate bundle to slim the core

前往 GitHub
$ dsh plugin --profile web add @huanlin/dsh-plugin-better-sidebar-plugin-office

36

星标

2

Fork

JavaScript

语言

NOASSERTION

许可证

2026-08-12

创建于

2026-09-03

最近推送

原生 DSH Web 插件,在 better-sidebar 编辑器内预览 Word / Excel / PowerPoint 文件,并以独立 bundle 形式让核心保持精简。

DSH 适配

原生运行时

作者声明

安全审计

未审计

最后核验

2026-09-03

许可证

NOASSERTION

01它能帮你完成什么?

  • Preview Office documents (.docx/.xlsx/.pptx) inside the better-sidebar file explorer

    In-browser rendered viewers — docx-preview for Word, Univer sheets for Excel, @aiden0z/pptx-renderer for PowerPoint — auto-matched by file extension

    better-sidebar users who receive Office attachments and want to preview them without leaving the editor

  • Keep the better-sidebar core client bundle small while still offering Office preview

    Office renderers shipped as a separate plugin bundle instead of inlined into better-sidebar (~5.9MB full set → 2.2MB compressed)

    better-sidebar operators/maintainers who want a slim core and let users opt into heavy viewers on demand

02如何接入 DeepSeek Harness?

前置条件

  • better-sidebar `>= 0.6.0` (the release that removed the built-in office viewer); on older versions the plugin's `docx/xlsx/pptx` registration collides with the built-in one
  • A DeepSeek Harness `web` profile — the plugin is added to `--profile web` and served by the `dsh web` process

安装步骤

  1. 01

    Run `dsh plugin --profile web add @huanlin/dsh-plugin-better-sidebar-plugin-office` to install the plugin into the web profile

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

  2. 02

    Restart the `dsh web` process and hard-refresh the browser (`Ctrl+Shift+R`)

    $ dsh web

验证接入成功

  • Confirm the plugin file exists: `Test-Path ~/.dsh/profiles/web/node_modules/@huanlin/dsh-plugin-better-sidebar-plugin-office/lib/client.js` should return True
  • After restarting `dsh web` + hard refresh, open a `.docx`/`.xlsx`/`.pptx` from the sidebar — the preview should render normally

03DSH 适配与能力边界

DSH 适配原生运行时

Native DSH web plugin: installed with `dsh plugin --profile web add` and registers file viewers through the `ctx.betterSidebar.registerFileViewer` API in the better-sidebar editor.

  • Word (.docx) viewer

    `.docx` file opened in better-sidebarFaithful in-browser render via docx-preview (styles / images / tables, Alt+wheel zoom)

  • Excel (.xlsx) viewer

    `.xlsx` file opened in better-sidebarUniver sheets preset (data + formulas + merged cells + column width / row height)

  • PowerPoint (.pptx) viewer

    `.pptx` file opened in better-sidebarBrowser-native preview via @aiden0z/pptx-renderer with page navigation

  • Self-contained client component

    registered viewer descriptor (mediaUrl strategy, priority 0, title/icon)Viewers matching the original built-in descriptor shape, so existing file routing and the Side card toggle UI work unchanged

    loads/renders failures fall back to a download link

04适合谁?何时不该用?

适合

  • better-sidebar users who receive Office attachments and want to preview them without leaving the editor
  • better-sidebar operators/maintainers who want a slim core and let users opt into heavy viewers on demand

不适合

  • Requires better-sidebar `>= 0.6.0` (the release that removed the built-in office viewer); on older versions the plugin's `docx/xlsx/pptx` registration collides with the built-in one (`already registered`).
  • Changing the versions of jszip / xlsx / pptx-renderer can reintroduce Node builtin references (SheetJS/JSZip CJS fallbacks, pptx-renderer's PDF.js probe); the client bundle must be verified to contain no Node builtin.

05兼容性、维护与安全提示

  • Requires better-sidebar `>= 0.6.0` (the release that removed the built-in office viewer); on older versions the plugin's `docx/xlsx/pptx` registration collides with the built-in one (`already registered`).
  • Changing the versions of jszip / xlsx / pptx-renderer can reintroduce Node builtin references (SheetJS/JSZip CJS fallbacks, pptx-renderer's PDF.js probe); the client bundle must be verified to contain no Node builtin.
  • When a viewer fails to load or render, better-sidebar falls back to a download link instead of showing the preview.
2026-08-122026-09-03作者未说明

NOASSERTION · not released as a git tag yet (latest_release: null); README references the npm package @huanlin/dsh-plugin-better-sidebar-plugin-office

06常见问题

如何在 DeepSeek Harness 中安装这个插件?

执行 `dsh plugin --profile web add @huanlin/dsh-plugin-better-sidebar-plugin-office` 将其加入 `web` 配置档,然后重启 `dsh web` 进程并硬刷新浏览器(`Ctrl+Shift+R`)。

它支持预览哪些文件类型?

通过 `ctx.betterSidebar.registerFileViewer` 注册三个预览器:`docx`(docx-preview)、`xlsx`(Univer sheets)、`pptx`(@aiden0z/pptx-renderer)。在侧边栏打开对应文件时会按扩展名自动命中。

需要哪个版本的 better-sidebar?

需要 better-sidebar `>= 0.6.0`(已移除内置 office viewer 的版本)。在更早版本上,插件的 `docx/xlsx/pptx` 注册会与内置冲突并报 `already registered`。

为什么做成独立插件而不是内置到 better-sidebar?

docx-preview / Univer / pptx-renderer 曾把 client bundle 撑到约 23MB。拆成本插件后 better-sidebar 本体压缩后约 2.2MB,需要 Office 预览的用户再单独安装。

预览渲染失败会怎样?

加载/渲染失败时会回退到「下载查看」链接,且三个预览器会在 Side card 设置页显示为可单独启用/禁用的卡片。

08数据与来源

  • 作者声明github.comfbafdc6f8b1b…

    DSH web 插件:为 better-sidebar 的编辑器提供 Office 三件套文件预览(`.docx` / `.xlsx` / `.pptx`)。

  • 作者声明github.comfbafdc6f8b1b…

    通过 `ctx.betterSidebar.registerFileViewer` 注册 3 个 viewer(id 与内置一致):

  • 作者声明github.comfbafdc6f8b1b…

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

页面基于项目公开文档、仓库元数据和 DSH Plugins 的结构化解析生成;最后核验于 2026-09-03。发现错误?提交更正。

🏆

最佳 DeepSeek Harness 插件

从全目录挑出的 12 个值得优先安装的插件,覆盖各个分类。

DSH Plugins 是独立的 DeepSeek Harness 插件市场,与 DeepSeek 官方无关,也不代表官方背书。第三方插件未经安全审计,安装前请审查源码。

每周获取最新的 DeepSeek Harness 插件,绝不滥发。