Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type definitions for the latest Obsidian API.

License

NotificationsYou must be signed in to change notification settings

obsidianmd/obsidian-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Type definitions for the latestObsidian API.

Documentation

You can browse our Plugin API documentation athttps://docs.obsidian.md/

For an example on how to create Obsidian plugins, use the template athttps://github.com/obsidianmd/obsidian-sample-plugin

Issues and API requests

For issues with the API, or to make requests for new APIs, please go to our forum:https://forum.obsidian.md/c/developers-api/14

Plugin structure

manifest.json

  • id the ID of your plugin.
  • name the display name of your plugin.
  • author the plugin author's name.
  • version the version of your plugin.
  • minAppVersion the minimum required Obsidian version for your plugin.
  • description the long description of your plugin.
  • isDesktopOnly whether your plugin uses NodeJS or Electron APIs.
  • authorUrl (optional) a URL to your own website.
  • fundingUrl (optional) a link for users to donation to show appreciation and support plugin development.

main.js

  • This is the main entry point of your plugin.
  • Import any Obsidian API usingrequire('obsidian')
  • Import NodeJS or Electron API usingrequire('fs') orrequire('electron')
  • Must export a default class which extendsPlugin
  • Must bundle all external dependencies into this file, using Rollup, Webpack, or another javascript bundler.

App Architecture

The app is organized into a few major modules:
  • App, the global object that owns everything else. You can access this viathis.app inside your plugin. TheApp interface provides accessors for the following interfaces.
  • Vault, the interface that lets you interact with files and folders in the vault.
  • Workspace, the interface that lets you interact with panes on the screen.
  • MetadataCache, the interface that contains cached metadata about each markdown file, including headings, links, embeds, tags, and blocks.
Additionally, by inheritingPlugin, you can:
  • Add a ribbon icon usingthis.addRibbonIcon.
  • Add a status bar (bottom) element usingthis.addStatusBarItem.
  • Add a global command, optionally with a default hotkey, usingthis.addCommand.
  • Add a plugin settings tab usingthis.addSettingTab.
  • Register a new kind of view usingthis.registerView.
  • Save and load plugin data usingthis.loadData andthis.saveData.
Registering events

For registering events from any event interfaces, such asApp andWorkspace, please usethis.registerEvent, which will automatically detach your event handler when your plugin unloads:

this.registerEvent(app.on('event-name', callback));

If you register DOM events for elements that persist on the page after your plugin unloads, such aswindow ordocument events, please usethis.registerDomEvent:

this.registerDomEvent(element, 'click', callback);

If you usesetInterval, please usethis.registerInterval:

this.registerInterval(setInterval(callback, 1000));

About

Type definitions for the latest Obsidian API.

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp