跳到主内容 / Skip to content
Materin

首页Home / 内容Content / Materin Office

Materin Office v0.1.3

在 Obsidian 中直接读取、编辑并保存 Office 文件:.docx、.xlsx、.pptx、.xls、.doc、.ppt。

Read, edit and save Office files directly in Obsidian: .docx, .xlsx, .pptx, .xls, .doc, .ppt.

与系列共用同一套 UI 规范:Materin UIShares one UI spec with the series: Materin UI

概览

Materin Office 让你不必离开 Obsidian 就能处理 Office 文档。打开、预览、编辑、保存都在 vault 内完成,写回时只重写被修改的部件,其余字节原样保留。

它是 Materin 系列插件之一,兄弟插件为 Materin Ctx(JSON / YAML 编辑器)与 Materin View(OpenAPI 文档与调试)。

特性

格式能力
xlsx网格编辑器:单元格值编辑、公式显示、工作表切换;样式读取完整
xls与 xlsx 共享网格编辑器(值级编辑;样式写回有限)
docx高保真预览 + 文本级编辑(多 run 文本替换算法),原格式 100% 保留
pptx幻灯片画布 + 文本框编辑;仅重写被编辑的部件,其余字节不变
doc只读文本提取(word-extractor);不可编辑,可一键用系统应用打开
ppt暂不支持;规划中的外部打开入口

安全网:首次保存前自动备份原文件(可关闭);外部修改冲突检测。

安装

  1. 从 Release 页下载 main.js、manifest.json、styles.css;
  2. 放入 <vault>/.obsidian/plugins/materin-office/;
  3. 在 Obsidian 社区插件设置中启用 Materin Office。

源码仓库的 README 未单列安装章节,以上为 Obsidian 插件的通用流程;Release 0.1.3 的三个产物文件与此一致。最低 Obsidian 版本 1.7.2。

已知限制

  • xlsx 保存通过 ExcelJS 重写整个工作簿:图表、图片与透视缓存可能丢失(打开含此类内容的文件时会显示警告条;首次保存会自动备份)。
  • xls(BIFF 格式)保存仅保留单元格值,样式基本丢失 —— 建议转为 xlsx。
  • docx / pptx 为文本级编辑:改文字、查找替换;不支持格式变更(加粗、字号等)。
  • pptx 画布只覆盖 p:sp 文本形状:表格 / 图表中的文字尚不可编辑;无本地 xfrm 的占位符继承 slideLayout 几何(不再查找 slideMaster,个别母版布局的占位符可能落入“未定位文本框”区域)。
  • 公式由 Excel 在打开文件时重算,本插件不重算公式。

开发

npm install
npm run dev      # watch 模式,产物复制进 debug vault
npm run build    # 类型检查 + 生产构建
npm run test     # vitest
npm run lint     # eslint(目标 0/0)

调试:仓库根目录的 .debug-vault 是指向 ../debug-vault 的软链,该 vault 已安装热重载插件 —— 执行 npm run dev 后用 Obsidian 打开该 vault,改动即热加载。

许可

MIT。

内容来源

本页同步自仓库 README(leapord/Materin-office,最后提交 2026-09-20,版本 0.1.3)。以源码仓库为准。

Overview

Materin Office handles Office documents without leaving Obsidian. Opening, previewing, editing and saving all happen inside the vault, and writes only rewrite the parts you changed — every other byte is preserved.

It is one of the Materin plugins, alongside Materin Ctx (a JSON / YAML editor) and Materin View (OpenAPI docs and debugging).

Features

FormatCapability
xlsxGrid editor: cell value editing, formula display, sheet switching; full style reading
xlsShares the grid editor with xlsx (value-level editing; limited style write-back)
docxHigh-fidelity preview + text-level editing (multi-run text replacement algorithm); 100% of original formatting preserved
pptxSlide canvas + text box editing; only edited parts are rewritten, all other bytes untouched
docRead-only text extraction (word-extractor); not editable, with one-click open in a system app
pptNot yet supported; an external-open entry point is planned

Safety net: automatic backup of the original file before the first save (can be disabled); external modification conflict detection.

Install

  1. Download main.js, manifest.json and styles.css from the releases page;
  2. Put them into <vault>/.obsidian/plugins/materin-office/;
  3. Enable Materin Office in Obsidian's community plugin settings.

The source README does not list install steps; the above is the standard Obsidian plugin flow and matches the three artifacts shipped in release 0.1.3. Minimum Obsidian version: 1.7.2.

Known limitations

  • xlsx saving rewrites the entire workbook via ExcelJS: charts, images and pivot caches may be lost (a warning banner appears when opening files that contain them; the first save creates an automatic backup).
  • xls (BIFF format) saving keeps cell values only; styles are mostly lost — converting to xlsx is recommended.
  • docx / pptx editing is text-level: change text, find & replace. Formatting changes (bold, font size, etc.) are not supported.
  • The pptx canvas only covers p:sp text shapes: text inside tables / charts is not yet editable; placeholders without a local xfrm inherit geometry from slideLayout (slideMaster is no longer searched, so placeholders of some master layouts may fall into the "unpositioned text boxes" area).
  • Formulas are recalculated by Excel when the file is opened; this plugin does not recalculate them.

Development

npm install
npm run dev      # watch mode; output is copied into the debug vault
npm run build    # type check + production build
npm run test     # vitest
npm run lint     # eslint (target: 0/0)

Debugging: .debug-vault at the repository root is a symlink to ../debug-vault. A hot-reload plugin is installed in that vault — after npm run dev, open the vault in Obsidian and changes hot-load.

License

MIT.

Source

This page is synced from the repository README (leapord/Materin-office, last commit 2026-09-20, version 0.1.3). The source repository is authoritative.