Blog: accept custom reading time options
See original GitHub issue🚀 Feature
I’m working on the reading-time library renovation, and I plan to add much more options than what are currently available. (e.g. different reading speeds for CJK and Latin languages) It would be cool if we can expose these options to the end users.
Have you read the Contributing Guidelines on issues?
Yes
Has this been requested on Canny?
No
Motivation
To make use of the customizability of reading-time—also, sometimes the default reading time is just not sensical enough.
API Design
A new plugin option readingTimeOptions which is directly passed to the readingTime function. Currently the options only include wordsPerMinute and wordBound, but there will be many more. cf https://github.com/ngryman/reading-time/pull/42#issuecomment-919900955
Have you tried building it?
No
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
How to Display Estimated Post Reading Time in Your ...
The easiest way to add estimated post-reading time is by using the Read Meter plugin. It's a free WordPress plugin that helps you...
Read more >How to Display Estimated Reading Time in WordPress Blogs
Want to show customized estimated reading time in WordPress? PostX brings you this amazing opportunity right in your hand.
Read more >How To Add Estimated Reading Time In Your WordPress Posts
Go to Settings -> Reading Time WP from the left sidebar panel. ... Once you are done, just go to Appearance -> Customize...
Read more >How to Add An Estimated Post Reading Time To Your ...
In this article, we will show you two methods of adding an estimated post reading time to your WordPress posts. The first method...
Read more >How to Display Estimated Post Reading Time in Blogger Posts?
You might know about Medium.com? Have you noticed one of its cool feature? - Estimated Post Reading Time! An estimated reading time encourages...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

“Guess” the language, sort of. The locale doesn’t really matter. I write some articles that are almost 50/50 Chinese and English. After all, it’s just about the word-counting algorithm, which should really be consistent across locales.
You provide multiple options:
CJKCharactersPerMinute,LatinWordsPerMinute,CyrillicWordsPerMinute, etc.I just feel like the default reading time function is already very usable, and we just need to inject additional options. Otherwise, the user would need to
require readingTimeevery time, and… that’s unnecessary IMOYes, that was my idea 😉 custom frontmatter could be used to tweak that algo
👍
For the callback that makes sense but maybe we should allow providing a frontMatter readingTime as a string as well? Probably overkill, we can add that later if there’s an use-case