@julian said in Advanced Editor Plugin:
You'll probably want to use the Quill Composer, which is our official (in development) WYSIWYG composer.
You should be able to download it from the plugins list.
😄
Don't you use markdown here?
This plugin allows defining keywords and descriptions in the admin control panel. These keywords will display a tooltip when the user mouse overs them in posts. Keywords are also displayed at /glossary along with information about each keyword.
npm install nodebb-plugin-glossary
More info:
@baris Perhaps I missed something here, but I've installed the plugin, but cannot see any reference to it in the ACP ? It's installed and active. On checking the logs, I see
2021-11-10T11:08:08.547Z [4567/1025689] - [33mwarn[39m: [plugins/nodebb-plugin-glossary] The plugin.json field "library" is deprecated. Please use the package.json field "main" instead.
2021-11-10T11:08:08.548Z [4567/1025689] - [33mwarn[39m: [plugins] Unable to load library for: nodebb-plugin-glossary
2021-11-10T11:08:08.548Z [4567/1025689] - [31merror[39m: Error: Cannot find module 'XRegExp'
Require stack:
- /home/sudonix/nodebb/require-main.js
- /home/sudonix/nodebb/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Module.require.main.require (/home/sudonix/nodebb/require-main.js:8:10)
at Object.<anonymous> (/home/sudonix/nodebb/node_modules/nodebb-plugin-glossary/library.js:5:30)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
I tried npm i xregexp
and then a rebuild, but still got the same message
@phenomlab Can you try with [email protected]?
@baris That works ! Thanks
@baris is it possible to enable some form of CSV import for for this plugin ? I have potentially a large list of items I want to include, and typing them all manually would be very time consuming
Thanks
@baris I noticed that the GitHub feature has been closed. Well this new feature be added to the version in npm ?
Thanks
It is in version 0.0.5
@baris thanks
@baris [email protected]
doesn't seem to exist ?
Hmm that's weird, maybe I forgot to publish. It is published now.
@baris Thanks - I see it now.
@baris One thing I've noticed here is that the plugin seems gratuitous in terms of REGEX - it's matching on any part of the word, meaning things like AI
is detected inside disdain
and certain
- is there any way we can have a setting that looks for a complete match rather than partial ?
That sounds like a bug, please file it on the github repo. It should only match on whole words.
@baris I found the issue (for my case). In library.js
the regex statement looks for insensitive as below
keyword.nameRegex = XRegExp(`(?:^|\\s|\\>|;)(${keyword.name})`, 'gi');
I've changed it to
keyword.nameRegex = XRegExp(`(?:^|\\s|\\>|;)(${keyword.name})`, 'g');
Which works fine for my use case (virtually all of the acronyms I have are in upper case). However, lower case words are still affected.
Seems like it is already matching the whole world AI
it just matches lowercase as well. I can make the case-sensitivity an option in the ACP page.
@baris Yep, that would be great..
@baris From what I see, the plugin is actually firing on whole words
In this case, it's matching on bits
as well as bit
(which it should)
And also matching on dev
inside devil
EDIT: Sorry - this was due to the CSV import I have... Ignore that
@baris another suggestion would be to empty the table storing the glossary items. When you import 1000 plus from a CSV it's very clunky to have to delete them all one by one if you need to.
Published 0.0.7, with bunch of fixes and new options.