Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提供插入块、更新块和删除块的 API #3334

Closed
bestv5 opened this issue Nov 5, 2021 · 5 comments
Closed

提供插入块、更新块和删除块的 API #3334

bestv5 opened this issue Nov 5, 2021 · 5 comments
Assignees
Labels
Milestone

Comments

@bestv5
Copy link

bestv5 commented Nov 5, 2021

希望在API中增加一个接口,通过data-id或者其他唯一主键,更新块内容。
例如:
参数:data-id:123456 必填
data-content:块内容(可选,空就从笔记内获取)
通过这个api接口,可以更新笔记块内的内容。

@88250 88250 changed the title 增加保存文本内容的API 提供插入块和更新块的接口 Nov 5, 2021
@88250 88250 self-assigned this Nov 5, 2021
@Crowds21
Copy link

看到这个API一下想到,当初是不是数据库中保留 next_id和 front_id 会好一点. 😂

@Crowds21
Copy link

Crowds21 commented Dec 7, 2021

对于编辑操作我感觉一般大家应该不会涉及到太复杂的操作,我觉得我可能用到的如下:

  1. 通过指定的ID修改块内容,如果担心不同类型的块转换容易出问题,可以先只支持同类型块的内容修改.
  2. 在指定的文档末尾添加内容
  3. 删除块

D大可能一直在担心第一个.但我觉得绝大多数人,可能也只是用这个来給 - [ ] 更改一下状态,或者是删除一下#TODO#标签. 再多就是批量删除或更改块的内容.
是不是可以先不考虑块类型之间的互相变化. 后续再提供专门的块类型转换的接口?

  • id: 如果为block则修改block内容, 如果为doc 则直接在doc末添加内容
  • action: update / delete
  • content: 只支持一个块的content修改,而不支持makrdown修改

一点粗浅的想法.

@WeiCJ2020
Copy link

现在这个有计划了吗?感觉api完善之后, 有很多的辅助应用可以开发

@88250
Copy link
Member

88250 commented Dec 9, 2021

需要考虑数据格式,目前有三种备选:JSON、kramdown 和 DOM,无论使用那种格式,都需要通过 Lute 进行解析,还需要时间进一步考虑。

@88250 88250 added the Feature label Dec 29, 2021
@88250 88250 added this to the backlog milestone Dec 29, 2021
@88250 88250 changed the title 提供插入块和更新块的接口 提供插入块和更新块的 API Dec 29, 2021
@88250 88250 modified the milestones: backlog, 1.6.0 Dec 30, 2021
@88250 88250 changed the title 提供插入块和更新块的 API 提供插入块、更新块和删除块的 API Dec 30, 2021
@88250 88250 closed this as completed Dec 30, 2021
@88250
Copy link
Member

88250 commented Dec 30, 2021

文档见此

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants