MCPcopy Create free account
hub / github.com/cweijan/vscode-office

github.com/cweijan/vscode-office @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
6,695 symbols 19,702 edges 563 files ⚖ MIT 101 documented · 2% updated 15d ago★ 1,63554 open issues

Browse by type

Functions 5,724 Types & classes 971
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Office Viewer

English | 简体中文 | 繁體中文

介紹

本擴充功能支援在 VS Code 中預覽以下常見的辦公檔案格式:

  • Excel: .xls.xlsx.xlsm.csv.ods
  • Word: .docx.dotx
  • PowerPoint: .pptx.pptm
  • PDF 與電子書: .pdf.epub
  • HEIC/TIFF: .heic.heif.tiff
  • 設計檔案: .psd.xmind.icns.svg
  • 字型: .ttf.otf.woff.woff2
  • Markdown: .md.markdown
  • HTML: .html.htm
  • HTTP 請求: .http.rest
  • Java: .class(反編譯)
  • 壓縮檔案: .zip.jar.vsix.rar.7z.tar.tar.gz.tgz.apk

Git 歷史

Office Viewer 內建完整的 Git 歷史工作區,讓你無需離開 VS Code 即可瀏覽儲存庫。可從原始碼控制檢視、編輯器標題列、編輯器右鍵選單或檔案總管右鍵選單開啟。

1783342874748

Markdown

整合 Markdown 所見即所得編輯器。

如需使用 VS Code 原生 Markdown 編輯器,請在 settings.json 中新增以下設定:

{
    "workbench.editorAssociations": {
        "*.md": "default",
        "*.markdown": "default"
    }
}

在編輯器中按右鍵,可將 Markdown 匯出為 PDF、DOCX 或 HTML。PDF 匯出依賴 Chromium,可透過 vscode-office.chromiumPath 設定瀏覽器路徑。

匯出 Markdown

快捷鍵:基於 shortcut.md,以及:

  • 新行: Ctrl+Enter / ⌘ Enter
  • 硬換行: Shift+Enter / ⇧ Enter
  • 編輯超連結: Alt+Enter / ^ Enter
  • 設定 CodeMirror 語言: Alt+Enter / ^ Enter
  • 在 VS Code 中編輯: Ctrl Alt E / ⌘ ^ E
  • 貼上為純文字: Ctrl+Shift+V / ⌘ ⇧ V

其他功能

  • HTML: 編輯時按下 Ctrl+Shift+V 可即時預覽
  • YAML: 支援文件大綱與錨點導覽(別名引用可跳轉到定義)
  • 圖示主題: 內建 Material Icon Theme 部分圖示,並提供 Office Material Icon ThemeOne Dark Modern 配色主題
  • Excel: 支援預覽與儲存 .xlsx.xls.xlsm.csv.ods 等檔案
  • HTTP: 在 .http.rest 檔案中傳送請求(整合自 REST Client,並修正了本地請求的已知問題);按 Ctrl+Enter / ⌘ Enter 傳送
  • Java: 開啟 .class 檔案可反編譯並查看原始碼

Sponsor

Database Client

適用於 Visual Studio Code 的資料庫用戶端,支援 MySQL/MariaDB、PostgreSQL、SQLite、Redis 以及 ElasticSearch 等資料庫的管理,且可作為 SSH 用戶端,極大地提升您的生產力!立刻安裝

開發指南

環境要求

快速開始

git clone https://github.com/cweijan/vscode-office.git
cd vscode-office
npm install

開發除錯

桌面端擴充功能(完整功能):

npm run dev

在 VS Code 中按 F5,或在「執行和偵錯」中選擇 Extension

Web 端擴充功能(瀏覽器中的 Markdown、HTML、YAML):

npm run dev:web

在「執行和偵錯」中選擇 Extension (Web)

建置與打包

npm run build    # 生產建置
npm run package  # 產生 .vsix

使用資料(Usage Data)

Office Viewer 會收集匿名使用資料,用於了解各預覽功能的使用情況,以便改進擴充功能。資料透過官方模組 @vscode/extension-telemetry 傳送至 Azure Application Insights

收集內容

事件 觸發時機 屬性
view.open 開啟自訂預覽/編輯器 viewType(如 excelmarkdownpdf)、fileType(僅副檔名,如 xlsxmd

不會收集檔案路徑、檔名、URL、儲存庫名稱、請求內容或其他可識別個人身份的資訊。

如何關閉

僅在以下兩項均允許時才會上報:

  1. VS Code 全域遙測已開啟(telemetry.telemetryLevel 不為 off,或舊版中 telemetry.enableTelemetrytrue)。
  2. 擴充功能遙測已開啟:在設定中將 vscode-office.enableTelemetry 設為 false 可單獨關閉本擴充功能的上報。

也可在 設定 → 應用程式 → 遙測 中關閉 VS Code 的全部遙測。

維護者設定

若自行建置並發佈本擴充功能,請參閱 docs/telemetry.md 設定 Azure Application Insights 及範例查詢。

Credits

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 2,900
Method 2,824
Class 712
Interface 250
Enum 9

Languages

TypeScript100%

Modules by API surface

resource/pdf/pdf.worker.js771 symbols
resource/pdf/viewer.js662 symbols
resource/pdf/pdf.js541 symbols
vditor/src/js/katex/katex.min.js316 symbols
vditor/src/ts/codeBlock/codeMirrorManager.ts129 symbols
public/woff2_decompress_binding.js100 symbols
src/react/view/excel/x-spreadsheet/core/data_proxy.js97 symbols
src/react/view/excel/x-spreadsheet/component/sheet.js63 symbols
src/react/view/excel/x-spreadsheet/index.ts58 symbols
vditor/src/types/index.d.ts54 symbols
vditor/src/ts/util/fixBrowserBehavior.ts51 symbols
vditor/src/ts/wysiwyg/tableHandle.ts47 symbols

For agents

$ claude mcp add vscode-office \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page