Plugins
Plugins add commands, preview renderers and import and export formats to Devot. Each one runs in a sandbox and can do only what you approved.
What a plugin can do
A plugin can add commands to the command palette, items to the Plugins menu, keyboard shortcuts, renderers that draw a kind of code block in the preview, and import and export formats.
It runs in a sandbox of its own, in the main window only. It cannot reach the network, your other notes, storage or another plugin, and it reads or changes the open note only with your permission and only while one of its commands runs. Plugins never sync and backups leave them out.
Install a plugin
- Download the plugin's archive (a
.zipfile) from the index below. - In Devot, open Settings > Plugins and choose Install from Archive, or Install from Folder for a plugin you unpacked or wrote.
- Read what it asks for, then choose Install. Cancel installs nothing.
The same pane turns plugins on and off, lists their permissions and removes them. Installing a newer version replaces the old one whole.
The index
Plugins listed here have public source. Devot checks every package when you install it, whoever made it, so read what a plugin asks for before you approve it.
- CSV Tables, by Devot. Imports CSV and TSV files as notes holding a Markdown table, and draws csv code blocks as tables in the preview. It can draw code blocks in the preview and add an import format. Download CSV Tables
- Charts, by Devot. Draws chart code blocks as bar or line charts in the preview, from rows of a label and numbers, in light and dark. It can draw code blocks in the preview. Download Charts
- BibTeX References, by Devot. Imports .bib files as notes of formatted references, and shows bibtex code blocks as a reference list in the preview. It can draw code blocks in the preview and add an import format. Download BibTeX References
- Note Query, by Devot. Shows query code blocks as a live table or list of the notes that match, by tag, notebook, status, dates and front matter. Needs Devot 1.1.8. It can draw code blocks in the preview and read all notes. Download Note Query
- Graphviz, by Devot. Draws dot code blocks as Graphviz diagrams in the preview, in the colours of the theme on screen, without a network. Needs Devot 1.1.8. It can draw code blocks in the preview. Download Graphviz
- Excalidraw, by Devot. Draws excalidraw code blocks as hand-drawn sketches in the preview, and edits them in a whiteboard in the plugin panel. Needs Devot 1.1.8. It can draw code blocks in the preview. Download Excalidraw
- Catppuccin, by Devot. The Catppuccin themes in soothing pastels: Latte for Light Mode; Frappé, Macchiato and Mocha for Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Catppuccin
- Tokyo Night, by Devot. The Tokyo Night themes in blues and violets: Tokyo Night Light for Light Mode; Tokyo Night and Storm for Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Tokyo Night
- Dracula, by Devot. The Dracula theme, vivid purple, pink and green on deep gray, for Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Dracula
- Nord, by Devot. The Nord theme of calm arctic blues and frosted grays, for Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Nord
- Gruvbox, by Devot. The Gruvbox themes in warm retro browns, yellows and greens, for Light Mode and Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Gruvbox
- Solarized, by Devot. The Solarized themes of cream and deep teal, for Light Mode and Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Solarized
- Rosé Pine, by Devot. The Rosé Pine themes in muted rose, pine and gold: Dawn for Light Mode; Rosé Pine and Moon for Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download Rosé Pine
- One Dark and Light, by Devot. The One themes of cool grays and soft colors: One Light for Light Mode, One Dark for Dark Mode. Needs Devot 1.1.8. It can add colour themes. Download One Dark and Light
Write a plugin
A plugin is a folder with a manifest, devot-plugin.json, and a script. The manifest names the plugin, the permissions it asks for and what it adds:
{
"id": "com.example.csv-tables",
"name": "CSV Tables",
"version": "1.0.0",
"apiVersion": 1,
"author": "Your name",
"main": "main.js",
"permissions": ["preview", "import"],
"contributes": {
"previewRenderers": [{ "id": "csv", "language": "csv" }],
"importFormats": [{ "id": "csv", "title": "CSV Table", "extensions": ["csv"] }]
}
}The script registers a handler for each thing the manifest adds, on the global devot:
devot.commands.handle(id, run): runs a command.devot.preview.handle(id, (source) => markdown): draws a code block as Markdown, which the preview renders and sanitizes like note text; null keeps it as code.devot.importer.handle(id, ({ name, text }) => ({ title, markdown })): turns a file into a note.devot.exporter.handle(id, ({ title, markdown }) => text): turns the open note into a file.devot.note.read()anddevot.note.replace({ base, markdown }): read and change the open note while a command runs; a change is refused when the note changed since it was read.devot.ui.show({ height })anddevot.ui.hide(): show the plugin's page in a sheet, from one of its commands.
devot.preview.handle('csv', (source) => {
const rows = source.trim().split('\n').map((line) => line.split(','))
const line = (cells) => `| ${cells.join(' | ')} |`
const rule = `|${' --- |'.repeat(rows[0].length)}`
return [line(rows[0]), rule, ...rows.slice(1).map(line)].join('\n')
})The full rules, limits and error codes are in the extensions spec. The CSV Tables source above is a complete example.
List your plugin
- Publish its source in a public repository, with an archive of each version to download.
- Open a pull request on the site's repository that adds it to
src/i18n/en/plugins.ts: its ID, name, author, a one-sentence summary, the permissions its manifest asks for, its source and its archive.
A listing names exactly the permissions the plugin asks for, and a plugin that reaches for more than it says is taken out.