Plugin Development
Build custom plugins to extend Vandrite's functionality
Plugin Development
Welcome to the Vandrite Plugin Development Guide! This section covers everything you need to know to build powerful plugins for Vandrite.
Overview
Vandrite plugins are TypeScript/JavaScript modules that extend the app's functionality. With the Plugin API, you can:
- Add custom commands to the command palette
- Listen to and respond to events
- Interact with files in the vault
- Create custom UI modals
- Register keyboard shortcuts
- Manipulate the editor content
- Access theme settings
Quick Start
Get started building your first plugin in just a few steps:
Getting Started
Create your first plugin from scratch
Plugin Manifest
Configure your plugin's metadata
API Reference
Explore all available APIs
Plugin Settings
Add configurable settings to your plugin
Installation
npm install @vandrite/plugin-apiBasic Example
import { Plugin } from "@vandrite/plugin-api";
export default class MyPlugin extends Plugin {
async onload() {
console.log("Plugin loaded!");
this.addCommand({
id: "my-command",
name: "Say Hello",
callback: () => {
this.app.events.trigger("notice", "Hello from my plugin!");
},
});
}
onunload() {
console.log("Plugin unloaded!");
}
}API Categories
| API | Description |
|---|---|
| app.commands | Register and execute commands |
| app.events | Subscribe to application events |
| app.vault | Access files in the vault |
| app.modals | Show dialogs and prompts |
| app.hotkeys | Register keyboard shortcuts |
| app.editor | Interact with the text editor |
| app.theme | Access and modify themes |