Adds a dropdown button to Kanka’s Summernote editor toolbar that can be used to insert HTML snippets from various Marketplace themes with a simple click. No need to memorize or look up the code, nor to type it all in or copy-paste it into the editor. Just select the plugin (and variant, if applicable) and edit its snippet as needed. This is compatible with both the visual and code editors.
To appear in the dropdown, a theme must be:
- officially supported by the theme’s creator and this userscript’s maintainer;
- installed and enabled on the campaign.
(For the initial release, a few themes are enabled by default whether or not you have installed them. This will be cleaned up as plugin makers start to officially support this script.)
Theme makers looking to add your plugins to this tool:
For your theme to be considered for addition, it will need:
- to rely on adding HTML elements to the entry (themes that rely on adding classes to existing elements are not suitable for this script);
- to contain a CSS custom property on the root element, which will act as a flag to let this script know that the plugin is enabled on a campaign. This flag will look like
:root { --summernote-insert-<plugin-name>: enabled; }
.
Please contact me (@Salvatos) via Kanka’s Discord (#marketplace channel) to get your theme added to the script. While not mandatory, I would also appreciate if your plugin’s description mentioned and linked to this script. Here is an example you can use:
<p><i><b>This plugin supports the </b><a href="https://gf.qytechs.cn/en/scripts/429931-kanka-marketplace-plugin-html-inserter-for-summernote" target="_blank">Marketplace Plugin HTML Inserter for Summernote</a><b>!</b> You can install this user script with a browser extension to insert the necessary HTML in your entities without memorizing or referencing this page.</i></p>