Once you've crafted the code for your plugin, you'll need to create a JSON description of your package, so that it can be imported using the Extension manager.
The JSON description must be hosted on a URL the app can reach out to. In these steps, we'll use Listed to generate a JSON endpoint.
---
metatype: json
---
{
"identifier": "org.yourdomain.my-markdown-editor",
"name": "My Markdown Editor",
"content_type": "SN|Component",
"area": "editor-editor",
"version": "1.0.0",
"description": "A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.",
"url": "https://domain.org/link-to-hosted-plugin",
"download_url": "https://github.com/sn-plugins/advanced-markdown-editor/archive/1.0.184.zip",
"latest_url": "https://listed.to/my-plugin-json-link",
"marketing_url": "https://standardnotes.com/features/advanced-markdown",
"thumbnail_url": "https://domain.org/editors/adv-markdown.jpg"
}
Head over to listed.to, and generate an account by clicking "Generate Author Link". Copy that link, then, in the Extensions menu in Standard Notes, click "Import Extension" in the bottom right corner. Paste in your link, and press enter, then accept.
Back in your "my-plugin.json" note, click "Actions" in the menu bar below the note title, then click "Publish to Private Link". Click "Open Private Link" to preview your JSON endpoint.
In the Extensions window, click "Import Extension", and paste in your JSON endpoint, press Enter, then accept to install your plugin.
Key | Description |
---|---|
identifier | A unique, reverse domain style identifier for your plugin. |
name | The name of your plugin. |
content_type | Generally SN|Component, or SN|Theme if theme package. |
area | One of [editor-editor, editor-stack, themes, note-tags, tags-list] |
version | The current version of your plugin. Needs to match the version in your GitHub repo's package.json file. |
description | The description that will be displayed in the Extensions browser. |
url | Used by the web and mobile app. This value is the location of the hosted plugin. It must be a link to either an HTML file (for components) or a CSS file (for themes). |
download_url | Used by the desktop app. Must be a zip file. Caters strongly to GitHub auto-generated release files. The zip file must contain a package.json file with at least a version key. By default, the desktop app will look for an "index.html" in the root directory of the zip file. (Note that if using GitHub auto-generated zip files, the contents of the zip file are embedded within a folder. The desktop app automatically unnests the folder contents and moves it up one level so it is on the root level.) If your main file is not called index.html, or if it is a CSS file, please see below in "Local Installation" under "To specify the root file of your plugin" instructions. |
marketing_url | If specified, the Extensions manager will display an "Info" button, which on click, will open a web browser to this location. |
thumbnail_url | The image the Extensions manager will display for your plugin. |
Extensions in Standard Notes desktop support local installation. We recommend using GitHub releases to host your download file.
In your plugin repository on GitHub, go to the Releases tab, then click "Draft New Release".
Click "Publish release" (you don't need to enter any information). Standard Notes will use the auto-generated "Source code (zip)" archive that GitHub generates.
Right click on "Source code (zip)", then choose the option to Copy Link Address. Use this value for download_url
in your JSON contents.
By default, Standard Notes will look for the index.html
file located in the root of the project. If your main file is not in the root, you can specify a custom path.
In your plugin's repository, create a file called package.json
if it does not already exist.
Add the following entry anywhere in the root level of package.json
:
...
"sn": {
"main": "relative/path/to/index.html"
},
...
main
can also be a CSS file if you're publishing a theme.
Standard Notes will ping the latest_url
endpoint automatically to update plugins. For this value, you can use the same JSON endpoint you're using for url
(your my-plugin.json
endpoint).
Join the Discord group and ask away in the #dev channel.