This is a sample plugin of siyuan plugin system.
Clone the project to your computer. Use pnpm install
to install the dependencies. Pnpm is mordern node module manager. You can learn it from Pnpm website.
Then you can find the entry of plugin at src/index.ts
, which export a default class. Plugins must export a default class which extended from Plugin
. Plugin has onload
and onunload
lifecycle hook. Which will called when the plugin is loaded and unloaded.
Run pnpm build
to generate the target main.js
in dist/ folder. Copy it and the manifest.json and put them into plugins/<pluginName> folder in your Siyuan workspace, like workspace/data/plugins/siyuan-plugin-sample
.
Feel free to install your own dependencies, like vue
, react
, svelte
and so on.
You should write a manifest.json file to describe the plugin. It contains name
, version
, description
, author
and url
.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。