添加批注
const r = await mn.api('/notes/' + noteid + '/comments', {
method: 'POST',
body: { text: '这句话是本段的中心句。', confirm: true }
});
if (r.error) mn.log(r.error.code);
{
"storedType": "text",
"storedText": "这句话是本段的中心句。",
"styled": true
}卡片与摘录
添加批注
追加一条批注。正文整条写成一个指向别处的应用内链接时,该条批注成为真正的双向链接。
format 只在新增时接受,改写现成的批注时带上该参数会被判非法。样式只有在按富文本写入时有效,
MarginNote 移除样式时响应里的 styled 为 false。
field 与 fieldLabel 用来把该条批注标成某个字段的值,便于同一张卡上放多组结构化内容。
POST
/
notes
/
{noteid}
/
comments
添加批注
const r = await mn.api('/notes/' + noteid + '/comments', {
method: 'POST',
body: { text: '这句话是本段的中心句。', confirm: true }
});
if (r.error) mn.log(r.error.code);
{
"storedType": "text",
"storedText": "这句话是本段的中心句。",
"styled": true
}路径参数
卡片的 noteid。取自卡片命令响应的 noteid、POST /notes/batch-get 响应里 items[].noteid,或 GET /ui-state 的 state.focusnoteid。
请求体
application/json
批注正文。整条写成一个 marginnote4app://note/… 链接时,该条批注成为真正的双向链接。
必填。由 MarginNote 自动补上。
正文的解析方式。改写现成批注时不接受该项。
可用选项:
text, markdown, html, rich 只有 format 为 rich 时生效。MarginNote 移除样式时响应里的 styled 为 false。
Show child attributes
Show child attributes
标出该条批注所属的字段,便于同一张卡上放多组结构化内容。
是否显示字段名。