Correct Trilium text notes with Antidote.
@druide-informatique/antidote-api-js can be found at jsdelivr. However, it cannot be used directly in Trilium. The script should be converted to CommonJS module first. This can be done using RollUp.
- Download the
index.min.jsfrom jsdelivr. - Use the following command to convert to CommonJS module
npx rollup index.min.js --file antidote.js --format cjs
- Copy the content of
widget.jsand paste into a JSX note in Trilium. Under this note, - Create a child code note (select
JS frontend, paste the contents ofutils.js. - Import
antidote.jsunderwidget.js - Create a CSS note and paste the content of
widget.cssinto it.
After reloading the front-end, you will be able to see a button at the bottom right for text notes.
- Launch the corrector with text notes, allow editing
- heading, paragraph, aside
- list items
- figure caption, including image and table captions
- Launch the corrector with code notes
- Text
- LaTeX
- Markdown
This extension uses the local Connectix rather than Antidote Web. To connect to Connectix, we need to know the port first. However, the port is not fixed once Connectix has started. We need to manually tell the extension of the port.
To do this, you need to add #antidotePort=<port number> to a note (any note). This port number can be obtained using the following command:
./AgentConnectixConsole --api
Output should be looking like below:
{"port":49156}
In this case, you should add #antidotePort=49156.
Note: if you use Trilium in the browser and installed Antidote Connector, this plugin will use Antidote Connector to get the WebSocket port, so you don't need to set #antidotePort.