mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 18:20:26 +08:00
📝 Update doc of kernel API insertBlock
Fix https://github.com/siyuan-note/siyuan/issues/8270
This commit is contained in:
parent
44f866ec8e
commit
c336a4d64e
9
API.md
9
API.md
@ -502,13 +502,20 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
|||||||
{
|
{
|
||||||
"dataType": "markdown",
|
"dataType": "markdown",
|
||||||
"data": "foo**bar**{: style=\"color: var(--b3-font-color8);\"}baz",
|
"data": "foo**bar**{: style=\"color: var(--b3-font-color8);\"}baz",
|
||||||
"previousID": "20211229114650-vrek5x6"
|
"nextID": "",
|
||||||
|
"previousID": "20211229114650-vrek5x6",
|
||||||
|
"parentID": ""
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* `dataType`: The data type to be inserted, the value can be `markdown` or `dom`
|
* `dataType`: The data type to be inserted, the value can be `markdown` or `dom`
|
||||||
* `data`: Data to be inserted
|
* `data`: Data to be inserted
|
||||||
|
* `nextID`: The ID of the next block, used to anchor the insertion position
|
||||||
* `previousID`: The ID of the previous block, used to anchor the insertion position
|
* `previousID`: The ID of the previous block, used to anchor the insertion position
|
||||||
|
* `parentID`: The ID of the parent block, used to anchor the insertion position
|
||||||
|
|
||||||
|
`nextID`, `previousID`, and `parentID` must have at least one value, using
|
||||||
|
priority: `nextID` > `previousID` > `parentID`
|
||||||
* Return value
|
* Return value
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
@ -496,13 +496,19 @@
|
|||||||
{
|
{
|
||||||
"dataType": "markdown",
|
"dataType": "markdown",
|
||||||
"data": "foo**bar**{: style=\"color: var(--b3-font-color8);\"}baz",
|
"data": "foo**bar**{: style=\"color: var(--b3-font-color8);\"}baz",
|
||||||
"previousID": "20211229114650-vrek5x6"
|
"nextID": "",
|
||||||
|
"previousID": "20211229114650-vrek5x6",
|
||||||
|
"parentID": ""
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* `dataType`:待插入数据类型,值可选择 `markdown` 或者 `dom`
|
* `dataType`:待插入数据类型,值可选择 `markdown` 或者 `dom`
|
||||||
* `data`:待插入的数据
|
* `data`:待插入的数据
|
||||||
|
* `nextID`:后一个块的 ID,用于锚定插入位置
|
||||||
* `previousID`:前一个块的 ID,用于锚定插入位置
|
* `previousID`:前一个块的 ID,用于锚定插入位置
|
||||||
|
* `parentID`:父块 ID,用于锚定插入位置
|
||||||
|
|
||||||
|
`nextID`、`previousID`、`parentID` 三个参数必须至少存在一个有值,优先级为 `nextID` > `previousID` > `parentID`
|
||||||
* 返回值
|
* 返回值
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
Loading…
Reference in New Issue
Block a user