Script API - how to add a code (js file) dependency? #6338
-
I'm trying to use the scripting API and by reading the wiki https://github.com/zadam/trilium/wiki/Scripts I can't figure out how to add a js library as a dependency to the code/script note. When I drag&drop a *.js file onto an existing sample code note, it will create another 'code note', different to how eg. Is there some docs I can follow? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
chart.js in the demo document is a note of "file" type - it's unreadable minified JS file so it does not make sense to make it editable. But otherwise JS dependency can be both code note or JS file, that does not matter. JS files are by default (e.g. with drag & drop) imported as code notes, if you want them as files, you can change the import settings in the import dialog. Unfortunately there isn't a good documentation - it's best to do it similarly to how demo scripts are built. |
Beta Was this translation helpful? Give feedback.
chart.js in the demo document is a note of "file" type - it's unreadable minified JS file so it does not make sense to make it editable.
But otherwise JS dependency can be both code note or JS file, that does not matter. JS files are by default (e.g. with drag & drop) imported as code notes, if you want them as files, you can change the import settings in the import dialog.
Unfortunately there isn't a good documentation - it's best to do it similarly to how demo scripts are built.