Sketch Measure 最新版本使用教程
1. 项目的目录结构及介绍
sketch-measure-latest/
├── README.md
├── sketch-measure.sketchplugin
│ ├── Contents
│ │ ├── Resources
│ │ │ ├── icons
│ │ │ └── ...
│ │ └── Sketch
│ │ ├── manifest.json
│ │ ├── my-command.js
│ │ └── ...
│ └── ...
└── ...
README.md
: 项目说明文件,包含项目的基本信息和使用方法。sketch-measure.sketchplugin
: Sketch 插件的主要文件夹。Contents/Resources
: 包含插件所需的资源文件,如图标等。Contents/Sketch
: 包含插件的核心代码和配置文件。manifest.json
: 插件的清单文件,定义了插件的名称、版本、命令等。my-command.js
: 插件的具体功能实现代码。
2. 项目的启动文件介绍
插件的启动文件主要是 manifest.json
,它定义了插件的基本信息和启动命令。以下是 manifest.json
的部分内容:
{
"name": "Sketch Measure",
"description": "Make it a fun to create spec for developers and teammates",
"author": "UTOM",
"homepage": "https://github.com/ellunium/sketch-measure-latest",
"version": "2.8.1",
"identifier": "com.utom.sketch-measure",
"commands": [
{
"name": "Spec Export",
"identifier": "spec-export",
"script": "my-command.js",
"handler": "onRun"
}
],
"menu": {
"title": "Sketch Measure",
"items": [
"spec-export"
]
}
}
name
: 插件的名称。description
: 插件的描述。author
: 插件的作者。version
: 插件的版本。identifier
: 插件的唯一标识符。commands
: 定义了插件的命令,每个命令包含名称、标识符、脚本文件和处理函数。menu
: 定义了插件在 Sketch 菜单中的显示方式。
3. 项目的配置文件介绍
插件的配置文件主要是 manifest.json
,它包含了插件的所有配置信息。以下是 manifest.json
的部分内容:
{
"name": "Sketch Measure",
"description": "Make it a fun to create spec for developers and teammates",
"author": "UTOM",
"homepage": "https://github.com/ellunium/sketch-measure-latest",
"version": "2.8.1",
"identifier": "com.utom.sketch-measure",
"commands": [
{
"name": "Spec Export",
"identifier": "spec-export",
"script": "my-command.js",
"handler": "onRun"
}
],
"menu": {
"title": "Sketch Measure",
"items": [
"spec-export"
]
}
}
name
: 插件的名称。description
: 插件的描述。author
: 插件的作者。version
: 插件的版本。identifier
: 插件的唯一标识符。commands
: 定义了插件的命令,每个命令包含名称、标识符、脚本文件和处理函数。menu
: 定义了插件在 Sketch 菜单中的显示方式。
通过 manifest.json
文件,可以配置插件的基本信息、命令和菜单显示方式,从而实现插件的自定义和扩展。