/obsidian-vue-sample-plugin

This is a Vue sample plugin for Obsidian. 基于 Vue 的 Obsidian 插件开发模板.

Primary LanguageJavaScriptMIT LicenseMIT


splash.png

obsidian.shield typescript.shield vue.shield esbuild.shield
status.shield license.shield

English简体中文 🕊️


Introduction 📜

This is a Vue sample plugin for Obsidian, and it should help get you started developing with TypeScript and Vue 3 in ESbuild.

This template depends on the latest Obsidian API: obsidian.d.ts.

Note: The Obsidian API is still in early alpha and is subject to change at any time!

Recommended IDE Setup 🛠️

  • vscode - IDE.
  • Volar - A vscode extension for Vue 3 language support.

Quick Starting Guide for Using This Repo 🧭

  • Check if someone already developed a plugin for what you want! There might be an existing plugin similar enough that you can partner up with.
  • Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you do not see it).
  • Clone your repo to a local development folder. For convenience, you can place this folder in the .obsidian/plugins folder.
  • Install Node.js, then run npm run chore or npm install to install the package dependencies.
  • Run npm run dev to compile your plugin to main.js and styles.css in a development mode. In this time, make changes to your TypeScript or Vue 3 code in the src folder, they will be automatically compiled to main.js and styles.css.
  • Reload Obsidian to load the newest version of your plugin, then enable your plugin in the Obsidian settings window.
  • Run npm run build to compile your plugin to main.js and styles.css in a release mode.

Learn More 📓

License ⚖️

MIT license.


简单介绍 📜

这是一个基于 Vue 的 Obsidian 插件开发模板, 它应该有助于您使用 TypeScriptVue 3 同时搭配 ESbuild 进行开发.

此模板依赖于最新的 Obsidian API: obsidian.d.ts.

请注意: Obsidian API 目前仍处于早期的 alpha 阶段, 因此随时都有可能发生变动!

推荐的 IDE 配置 🛠️

  • vscode - IDE.
  • Volar - 可以提供 Vue 3 语法支持的 vscode 插件.

使用此仓库的快速入门指南 🧭

  • 检查是否有人已经为您想要的东西开发了插件! 可能已经有了一个跟您预期足够相似的现有插件, 您可以和它的开发者进行合作.
  • 使用 "Use this template" 按钮将此仓库复制一份 (如果您没有看到这个按钮, 请先登录 GitHub).
  • 将您的仓库克隆到本地. 为了方便起见, 您可以将仓库放到 .obsidian/plugins 文件夹中.
  • 安装 Node.js, 然后运行 npm run chorenpm install 安装项目依赖.
  • 运行 npm run dev 可以在开发模式下将插件编译为 main.jsstyles.css 文件. 此时修改 src 文件夹中的 TypeScript 或 Vue 3 代码都可以自动热更新到 main.jsstyles.css 文件中.
  • 重新启动 Obsidian 以加载最新版本的插件, 然后在 Obsidian 的设置窗口中启用插件.
  • 运行 npm run build 可以在发布模式下将插件编译为 main.jsstyles.css 文件.

了解更多 📓

开源许可协议 ⚖️

MIT 开源许可协议.