DEV Community

dss99911
dss99911

Posted on • Originally published at dss99911.github.io

How to Develop an Obsidian Plugin - Getting Started Guide

Develop Obsidian Plugin

This guide is based on the official Obsidian documentation at https://docs.obsidian.md/Home and the sample plugin.

Setup

First, you need to install Node.js and npm. Here's how to set up your development environment:

# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# install npm, node
nvm install --lts

# install esbuild
npm install esbuild
Enter fullscreen mode Exit fullscreen mode

Install Sample Plugin on Obsidian

Download Obsidian Sample Plugin

VAULT_PATH="{your-vault-path}"
git clone https://github.com/obsidianmd/obsidian-sample-plugin.git
mv obsidian-sample-plugin $VAULT_PATH/.obsidian/plugins/obsidian-sample-plugin

cd $VAULT_PATH/.obsidian/plugins/obsidian-sample-plugin
Enter fullscreen mode Exit fullscreen mode

Run Dev Mode

npm run dev
Enter fullscreen mode Exit fullscreen mode

Enable the Plugin on Obsidian Setting

After running npm run dev, go to Obsidian Settings > Community Plugins and enable your sample plugin.

Debugging

Since Obsidian is an Electron app, you can use the Chromium developer tools to view an in-app console.

  • macOS: Cmd + Opt + I
  • Windows or Linux: Ctrl + Shift + I

Mobile Development

For mobile development, refer to the official documentation: https://docs.obsidian.md/Plugins/Getting+started/Mobile+development


Originally published at dss99911.github.io

Top comments (0)