JSPM

  • Created
  • Published
  • Downloads 369
  • Score
    100M100P100Q63708F
  • License GPL-3.0-or-later

Official API for creating extensions for OrgNote app

Package Exports

    Readme

    Table of Contents

    1. Introduction
    2. Connected links
    3. Extension structure
      1. Folder structure
      2. Extension entrypoint
      3. Extension manifest
      4. Extension API
    4. Publish to official repository
    5. Extensions example
    6. 🍩 Contribute guide

     

    Buy Me A Coffee donate button

    Patreon donate button

    wakatime

    Twitter link

    Mastodon Follow

    Discord

    YouTube Channel Views

    Introduction

    This is API for OrgNote extensions.

    Warning This API is not stable yet, so it can be changed in the future.

    You can find all available methods here. They are currently undocumented.

    Connected links

    Extension structure

    Folder structure

    Compiled extension should be placed in the index.js file or /dist/index.js file in the public GIT repository

    Extension entrypoint

    Each extension should export an object by default with the following structure:

    interface Extension {
      [key: string]: unknown;
    
      onMounted: (api: OrgNoteApi) => Promise<void>;
      onUnmounted?: (api: OrgNoteApi) => Promise<void>;
    }

    You can find available methods of OrgNoteApi here

    Extension manifest

    Also, each extension should export manifest const:

    interface ExtensionManifest {
      /* Should be unique in the extension repo */
      name: string;
      version: string;
      category: 'theme' | 'extension' | 'language pack' | 'other';
      /* OrgNote api semver, 0.13.4 for example */
      apiVersion?: string;
      author?: string;
      description?: string;
      keywords?: string[];
      // Repository url
      sourceType: 'git' | 'file' | 'builtin';
      /* Default value is README.org */
      readmeFilePath?: string;
      /* WIP */
      permissions?: Array<'files' | 'personal info' | '*' | 'third party'>;
      reloadRequired?: boolean;
      sourceUrl?: string;
      sponsor?: string[];
      development?: boolean;
      icon?: string;
    }

    Extension API

    Publish to official repository

    OrgNote has an official repository for user-based extensions. You can easily add new recipes/<package>.json with ExtensionManifest

    Extensions example

    Themes

    UI

    🍩 Contribute guide

    Any contribution is very much appreciated! Please read the style guide before contributing to avoid misunderstandings! I would also appreciate it if you would consider becoming my patron