# siyuan-plugin-sample **Repository Path**: zuoez02/siyuan-plugin-sample ## Basic Information - **Project Name**: siyuan-plugin-sample - **Description**: siyuan-plugin-sample, a sample of siyuan plugin in siyuan plugin system. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-03-07 - **Last Updated**: 2023-04-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Siyuan Sample Plugin This is a sample plugin of siyuan plugin system. ## Install 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](https://pnpm.io/). 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. ## Build Run `pnpm build` to generate the target `main.js` in dist/ folder. Copy it and the manifest.json and put them into plugins/\ folder in your Siyuan workspace, like `workspace/data/plugins/siyuan-plugin-sample`. ## Toolchain + Vite + Pnpm + Typescript: Strongly recommanded. Feel free to install your own dependencies, like `vue`, `react`, `svelte` and so on. ## Manifest You should write a manifest.json file to describe the plugin. It contains `name`, `version`, `description`, `author` and `url`.