# 檔案結構概述

插件是指一個包含多個檔案的安裝包，可直接分發給使用者。

<pre><code><strong>Plugin
</strong>├─ manifest.json
├─ logo.png
├─ index.html
└─ js
   └─ plugin.js
</code></pre>

<figure><img src="/files/K8Up7L7MsHjoeNcgA86x" alt=""><figcaption></figcaption></figure>

***

## manifest.json <a href="#zqpdi" id="zqpdi"></a>

這是每個插件必須擁有的檔案。它包含了有關插件的基本資訊，如插件的名稱、版本、執行程式碼入口等。不同插件類型有不同的設定方式，以下是「視窗插件」的基本設定：

```json
{
    "id": "LB5UL2P0Q9FFF",
    "version": "1.0.0",
    "name": "Hello World",
    "logo": "/logo.png",
    "keywords": ["keywrod1", "keywrod2"],
    "main":
    {
        "devTools": true,
        "url": "index.html",
        "width": 640,
        "height": 480
    }
}
```

* `id` - 插件 ID
* `version` - 插件版本
* `name` - 插件名
* `logo` - 插件代表圖示
* `keywords` - 插件關鍵字，除了插件名外使用者還可以使用這些關鍵字快速搜尋到這個插件
* `main` - 插件視窗程式入口設定
  * `url` - 入口頁面
  * `width` - 視窗寬度
  * `height` - 視窗高度

{% hint style="info" %}
注：你可以查看這篇文章，[瞭解 `manifest.json`的所有設定方式](/plugin-api/zh-tw/tutorial/manifest.md)。
{% endhint %}

{% hint style="info" %}
**完整範例程式碼：**

<https://github.com/eagle-app/eagle-plugin-examples/tree/main/Window>
{% endhint %}

## logo.png <a href="#pui04" id="pui04"></a>

對應 `manifest.json`中 `logo`欄位。代表插件的圖示，它將在插件列表及插件中心使用。請提供解析度為 128 x 128 的 圖片，圖示一般應該是PNG格式，因為 PNG 對透明度的支援最好。

***

## index.html <a href="#gmbp0" id="gmbp0"></a>

對應 `manifest.json` 中 `main`欄位。這是插件程式的入口檔案，插件執行時 `index.html`將被獨立載入在獨立的瀏覽器視窗中執行。


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.eagle.cool/plugin-api/zh-tw/get-started/anatomy-of-an-extension.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
