memos.pub icon indicating copy to clipboard operation
memos.pub copied to clipboard

feat(mdx): Add estimated reading time

Open unrealhoang opened this issue 2 years ago • 2 comments

to show the estimate read time of each post

unrealhoang avatar May 11 '22 09:05 unrealhoang

Could use something on top of https://github.com/syntax-tree/hast-util-reading-time

thien-do avatar May 11 '22 14:05 thien-do

Hm this turns out is not straightforward. The available tools are:

  • https://github.com/syntax-tree/hast-util-reading-time too low level
  • https://github.com/mattjennings/remark-reading-time use "reading-time" instead of the official low level tool
  • https://github.com/rehypejs/rehype-infer-reading-time-meta doesn't expose the info for us to use

I intended to mark this as good first issue but look like we will need to wait a bit more

thien-do avatar May 14 '22 18:05 thien-do