Plugins
Installing plugins, writing your first one, the core concepts, putting things on screen, and a tour of the API.
A plugin is a small program the editor loads from a public Git repository or a web address. It can add menu items, hotkeys, dialogs, panels, map tools and overlays, and it can read and change the open map through the same undo model the built-in tools use.
This page has eight parts:
- Using plugins: installing a plugin, what it is allowed to do, and updating or removing it. For map makers.
- Your first plugin: a small plugin built step by step, from a few lines in the playground to a published repository.
- Writing a plugin: the files, loading from your machine, bundling, translating, testing, debugging and publishing.
- Core concepts: the rules that hold across the whole API.
- Recipes: complete snippets for common jobs, such as a problems panel, a brush of your own, or triggers generated from a table.
- Putting things on screen: every place a plugin can show something, and the options each one takes.
- The API, group by group: what each group is for and the rules a signature does not show.
- Plugins to read: the project's own plugins, by what each one is a good example of.
Every call has its own entry in the API reference, generated from the editor's declarations. This page teaches and gives the rules; it links into the reference for signatures and options. How the editor loads plugins internally is in docs/development.md.
- Using pluginsThis part is for map makers: how to install and update plugins, and what you are trusting when you do.
- Your first pluginThis part builds one small plugin from nothing to a published repository.
- Writing a pluginA plugin is one TypeScript or JavaScript file exporting an activate(api) function, next to a plugin.json, in a public repository.
- Core conceptsThe rules on this page hold across the whole API. The rest of the guide refers back to them instead of repeating them.
- RecipesComplete snippets for common jobs, each using several parts of the API together.
- Putting things on screenEverything a plugin shows goes through api.ui, plus the menu, context-menu and hotkey groups.
- The API, group by groupThis part covers what each group is for and the rules that matter when using it.
- Plugins to readEach plugin is its own repository with a README, built against the same API.