addMenuItem UI.menu
¶
addMenuItem API allows plugin to create a menu item in INK Editor.
Syntax¶
addMenuItem(triggerCB: function, ...Structure: Array<String>)
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import INKAPI from './inkapi.js'
INKAPI.ready(() => {
const UI = INKAPI.ui;
// This will create a menu item entry at File > Export > Table of contents
UI.menu.addMenuItem(extractTOC, "File", "Export", "Table of contents");
function extractTOC() {
// triggered on menu item click
console.log("Table of contents");
}
});
|
Parameters¶
Name |
Type |
Description |
---|---|---|
triggerCB |
|
Required. a callback function which will be triggered on menu item click. |
Structure |
|
Required. All the parameters after first callback param will be a structure path to the menu item entry location. |