Plugin system for editors in lexonomy
Go to file
2024-01-10 12:06:12 +01:00
docker-compose.yml updated plugins dir location 2024-01-10 11:45:21 +01:00
Dockerfile updated plugins dir location 2024-01-10 11:45:21 +01:00 Initial: license 2019-09-16 17:19:14 +02:00
plugin-loader.js updated server scripts 2024-01-10 10:52:11 +01:00 updated plugins dir location 2024-01-10 11:45:21 +01:00
plugin.js updated README 2024-01-10 12:06:12 +01:00 updated README 2024-01-10 12:06:12 +01:00
requirements.txt added CORS 2022-06-14 18:47:32 +02:00

Plugin system for editors in lexonomy

This is a simple user-space plugin system for Lexonomy.

How it works?

It uses a javascript loader file, which loads plugins over the internet. This means that you need to serve plugins, which could be done just serving static files, but we implemented our server code, which does one more trick. The plugin is loaded at the touch of "edit" button and that is it.


Set the linked volume in docker-compose.yml to where you have your plugins directory. Then run the following command.

docker-compose -f docker-compose.yml up -d

This will make the application available on


Every plugin is a folder which is located where the server code is run from. A plugin consists of config.json file and any other file you want. config.json instructs plugin loader which files to load. Currently we support three keys in config.json:

  1. javascript: list of javascript files, local files have to be written as: "$LOCATION$/file.js"
  2. css: list of css stylesheets, local css have to be written as: "$LOCATION$/file.js"
  3. global: key-value list of {'name': file} - content of a file is stored in global variable name in browser javacsript. Same rule as above applies to local files.

Everytime you want to access local plugin files in javascript, css or wherever, you prepend $LOCATION$/ to the url. The plugin server takes care, that correct url is generated. This settings is found in URL value in server python code.

In order for a plugin to work, javascript should export three function:

plugin_init(div, entry)
plugin_render(div, entry)

Lexonomy Entry Editor Settings

To use it, you must first paste the javascript loader into custom entry editor section of Lexonomy configuration. Next, set correct url of your plugin. In order to work, the plugin must be accessible over HTTPS, if Lexonomy already runs on https. In order to run a server, you need to run a default redis server and have these python packages installed: flask and redis. Then you can run flask server on a server.


Let's say you are hosting plugins on and that there is a plugin (a folder) called myplugin in CWD/plugins/ of the server python process. You need to set:

  • plugin: "//" in javascript loader,
  • URL = "//" in python server,
  • the config.json file of myapi plugin has to be in "myplugin" folder on server

This is it.