Sketch 插件 Webview 模板使用教程

Sketch 插件 Webview 模板使用教程

sketchplugin-webview-templateA template for building Sketch plugins using a HTML page as user interface 项目地址:https://gitcode.com/gh_mirrors/sk/sketchplugin-webview-template

1. 项目的目录结构及介绍

sketchplugin-webview-template/
├── Contents/
│   ├── Sketch/
│   │   └── manifest.json
│   └── Resources/
│       ├── app.js
│       └── ui.html
├── LICENSE
├── README.md
├── appcast.xml
└── template.gif
  • Contents/: 主要文件夹,包含 Sketch 插件的核心文件。
    • Sketch/: 包含插件的元数据文件 manifest.json
    • Resources/: 包含插件的资源文件,如 app.jsui.html
  • LICENSE: 项目的许可证文件。
  • README.md: 项目的说明文档。
  • appcast.xml: 插件更新配置文件。
  • template.gif: 项目演示动画。

2. 项目的启动文件介绍

  • app.js: 这是插件的主要脚本文件,负责创建和管理 Webview 窗口,并处理与 UI 的交互。

3. 项目的配置文件介绍

  • manifest.json: 这是 Sketch 插件的元数据文件,包含插件的基本信息,如名称、作者、版本等。
{
  "name": "Webview Template",
  "identifier": "com.example.sketch.webview-template",
  "version": "1.0",
  "description": "A simple template for building Sketch plugins using a HTML page as user interface.",
  "author": "Jacopo Colò",
  "authorEmail": "jacopo.colo@example.com",
  "commands": [
    {
      "name": "Open Webview",
      "identifier": "openWebview",
      "script": "app.js",
      "handler": "onRun"
    }
  ],
  "menu": {
    "title": "Webview Template",
    "items": [
      "openWebview"
    ]
  }
}
  • appcast.xml: 这是插件的更新配置文件,用于自动更新插件。
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Webview Template Changelog</title>
    <link>https://example.com/appcast.xml</link>
    <description>Most recent changes with links to updates.</description>
    <language>en</language>
    <item>
      <title>Version 1.0</title>
      <description>Initial release.</description>
      <pubDate>2023-01-01T00:00:00+00:00</pubDate>
      <enclosure url="https://example.com/WebviewTemplate-1.0.zip" sparkle:version="1.0" length="1024" type="application/octet-stream"/>
    </item>
  </channel>
</rss>

以上是基于 jacopocolo/sketchplugin-webview-template 项目的详细教程。希望对您有所帮助!

sketchplugin-webview-templateA template for building Sketch plugins using a HTML page as user interface 项目地址:https://gitcode.com/gh_mirrors/sk/sketchplugin-webview-template

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

梅研芊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值