> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/work/file-library/online-editing.md).

# 線上編輯

直接在檔案庫編輯 Markdown、TXT、SQL、JSON 與 CSV 檔案，儲存即產生新版本；多人同時編輯時的處理方式，以及用上傳新版本更新其他格式。

小改動不用下載再上傳：文字類檔案可以直接在檔案庫裡編輯，按儲存就產生新版本，舊版本隨時可以還原。

{% hint style="info" %}
線上編輯需要組織另外開通。若檔案詳情中沒有 <mark style="color:blue;">編輯</mark> 按鈕，請洽組織管理員。
{% endhint %}

## 使用情境 <a href="#use-case" id="use-case"></a>

客服主管發現 FAQ 的一個錯字。她在檔案庫點開 FAQ.md，按 <mark style="color:blue;">編輯</mark> 直接修正那一行，切到 <mark style="color:blue;">預覽</mark> 確認排版沒問題後按 <mark style="color:blue;">儲存</mark>；右上角顯示「已儲存 v4」，版本清單也多了一筆她的修改。

***

## 編輯文字檔 <a href="#edit-text-file" id="edit-text-file"></a>

### 1. 開啟編輯器 <a href="#open-editor" id="open-editor"></a>

點選檔名開啟檔案詳情，按 <mark style="color:blue;">編輯</mark>，會開啟全頁編輯器。編輯器有行號與語法上色；CSV 檔以表格方式編輯，可以新增或刪除列。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-0dc4e48894ddd4c8c550d9517f14075bcd5c5ce7%2Ffile-library-online-editor.png?alt=media" alt="Markdown 線上編輯器，第 10 行已修改，右上角儲存按鈕可按"><figcaption><p>修改後右上角的儲存按鈕會變為可按</p></figcaption></figure>

### 2. 切換預覽 <a href="#preview" id="preview"></a>

Markdown 檔可以在上方切換 <mark style="color:blue;">編輯</mark> 與 <mark style="color:blue;">預覽</mark>。預覽模式不能修改，要回到 <mark style="color:blue;">編輯</mark> 才能繼續改。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-166386fe982835ddcd879327ed60cc584feec61c%2Ffile-library-online-editor-preview.png?alt=media" alt="Markdown 預覽模式，顯示排版後的 FAQ 內容"><figcaption><p>預覽排版後的內容</p></figcaption></figure>

### 3. 儲存為新版本 <a href="#save-version" id="save-version"></a>

按 <mark style="color:blue;">儲存</mark> 後，內容會存成新版本，右上角顯示「已儲存 v○」。版本選單可以查看歷次版本，或切回舊版本內容。編輯器不會自動儲存，離開前若有未儲存的變更，系統會提示你。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-9312bee2a01c22662002c09897bda7f1ba1fbc83%2Ffile-library-online-editor-versions.png?alt=media" alt="編輯器右上角的版本選單，列出目前版本 v4 與 v3、v2、v1"><figcaption><p>每次儲存都是一個新版本</p></figcaption></figure>

### 支援格式與上限 <a href="#supported-formats" id="supported-formats"></a>

| 格式                  | 上限                           |
| ------------------- | ---------------------------- |
| MD、TXT、SQL、JSON、CSV | 單檔 5 MB；CSV、JSON 最多 50,000 列 |

超過上限的檔案只能預覽與下載。

***

## 多人同時編輯 <a href="#concurrent-editing" id="concurrent-editing"></a>

如果你編輯時，同事已先儲存了新版本，按儲存時會提示「○○ 已於○○儲存新版本，你正在編輯的是 v○ 的內容」，並提供兩個選擇：

* <mark style="color:blue;">仍以我的內容儲存為新版本</mark>：保留你的修改，存成最新版本（同事那一版仍在版本清單中）
* <mark style="color:blue;">載入最新版本</mark>：放棄目前的修改，改從同事的最新版本繼續編輯

***

## 上傳新版本 <a href="#upload-new-version" id="upload-new-version"></a>

在本機改好的檔案，可以在檔案詳情使用 <mark style="color:blue;">上傳新版本</mark>，把它疊成同一份檔案的新版本，檔名與位置不變。上傳的檔案需要和原檔**相同格式**，單檔上限 10 MB；適用於文字類檔案與 XLSX、DOCX、PPTX。這個功能和線上編輯一樣需要組織開通。

***

## 相關頁面 <a href="#related" id="related"></a>

* [版本紀錄與還原](https://docs.maiagent.ai/work/file-library/versions.md)
* [讓 AI 修改、整理檔案](https://docs.maiagent.ai/work/file-library/ai-edit.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/work/file-library/online-editing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
