blob: 5d170308aefa78715e8af6ca4651b3d5920adf1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
## Reddit Hot News Sample
This is a sample that show you how to manipulate blocks :)
### Demo

### API
[](https://badge.fury.io/js/%40logseq%2Flibs)
##### [Logseq.Editor](https://logseq.github.io/plugins/interfaces/ieditorproxy.html)
- `insertBlock: (
srcBlock: BlockIdentity, content: string, opts?: Partial<{ before: boolean; sibling: boolean; properties: {} }>
) => Promise<BlockEntity | null>`
- `insertBatchBlock: (
srcBlock: BlockIdentity, batch: IBatchBlock | Array<IBatchBlock>, opts?: Partial<{ before: boolean, sibling: boolean }>
) => Promise<Array<BlockEntity> | null>`
- `updateBlock: (
srcBlock: BlockIdentity, content: string, opts?: Partial<{ properties: {} }>
) => Promise<void>`
- `removeBlock: (
srcBlock: BlockIdentity
)`
### Running the Sample
- `npm install && npm run build` in terminal to install dependencies.
- `Load unpacked plugin` in Logseq Desktop client.
|