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

增加段落评论功能有可能吗? #783

Open
rebron1900 opened this issue Feb 27, 2024 · 3 comments
Open

增加段落评论功能有可能吗? #783

rebron1900 opened this issue Feb 27, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@rebron1900
Copy link

如题,如果能单独对段落发起评论就好了。

思考了一下,也许可以对文章段落生成对应的段落ID,评论的数据附带这个ID,并在前端做一个显示适配

@rebron1900 rebron1900 changed the title 增加段落评价功能有可能吗? 增加段落评论功能有可能吗? Feb 27, 2024
@qwqcode qwqcode added the enhancement New feature or request label Mar 4, 2024
@awaae001
Copy link

那这样的适配就比较难搞了

@rebron1900
Copy link
Author

rebron1900 commented May 19, 2024

适配倒是好适配,我的想法是

  1. 在artalk里设置主文章容器元素,需要评论的段落元素,如:ppre
  2. 为这些元素生成鼠标悬浮小窗,并初始化评论总数,并在元素中记录该元素在文章中的顺序,如 data-artalk-index 之类的。
  3. 点击按钮弹出评论窗口,发送时可以以slug+段落id的形式记录,或者增加一个评论类型
  4. 主评论列表依旧正常显示,可以新增一个标识显示是评论的那个段落

就是文章主体结构不能大概,否则数据可能混乱。

@awaae001
Copy link

适配倒是好适配,我的想法是

  1. 在artalk里设置主文章容器元素,需要评论的段落元素,如:ppre

  2. 为这些元素生成鼠标悬浮小窗,并初始化评论总数,并在元素中记录该元素在文章中的顺序,如 data-artalk-index 之类的。

  3. 点击按钮弹出评论窗口,发送时可以以slug+段落id的形式记录,或者增加一个评论类型

  4. 主评论列表依旧正常显示,可以新增一个标识显示是评论的那个段落

就是文章主体结构不能大概,否则数据可能混乱。

我记得有人做过其他类型的,能不能够直接用JavaScript读取用户选中的内容,然后再引用并评论

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

No branches or pull requests

3 participants