列出可用插件命令
const r = await mn.api('/notes/' + noteid + '/addon-commands');
mn.log(r.commands, r.reason);{
"commands": [
{
"addon": "mn.vocab",
"commandId": "revert",
"title": "恢复成普通摘录"
}
],
"addonValues": {
"mn.vocab": {
"status": "done"
}
},
"pluginsAllowed": [
"mn.vocab"
]
}卡片与摘录
列出卡片可用插件命令
返回该卡当前菜单上可用的插件命令,以及插件存在该卡上的字段。
命令要出现在菜单上,需要以下各处齐备:插件清单里声明了 cardCommands,模板把该命令摆进
某张菜单,页面上监听了卡片命令事件。匹配的命令随卡的状态变化,判断条件由 MarginNote 在菜单
弹出时判定。
reason 说明本次没有命令可用的原因。
GET
/
notes
/
{noteid}
/
addon-commands
列出可用插件命令
const r = await mn.api('/notes/' + noteid + '/addon-commands');
mn.log(r.commands, r.reason);{
"commands": [
{
"addon": "mn.vocab",
"commandId": "revert",
"title": "恢复成普通摘录"
}
],
"addonValues": {
"mn.vocab": {
"status": "done"
}
},
"pluginsAllowed": [
"mn.vocab"
]
}路径参数
卡片的 noteid。取自卡片命令响应的 noteid、POST /notes/batch-get 响应里 items[].noteid,或 GET /ui-state 的 state.focusnoteid。