kiwix-js
kiwix-js copied to clipboard
Add a speed-reading option
It would allow the user to read an article very quickly. See https://github.com/Zolmeister/Zethos
Exactly where should I add this option? Can you be more specific?
@Swayamsvk I think this would need some quite careful thought. It's a very old issue (2014) and we might not give it high priority at the moment given the interface changes that are ongoing. IMHO it would be better to consider it once the interface has settled into its new form. See #574 .
It's true that the UI is currently a work-in-progress, and we don't know precisely where to add this option for now. But if @Swayamsvk intends to work on it, I think he can simply put an extra button next to the search button, so that to be able to play with this speed-reading feature.
In my opinion, here is what could be a first simple approach : when the button is pressed, it displays the speed-reading window in the center of the screen (above the article), and starts reading the whole article. If it works properly, there are many ways it should be improved, but it would a start.
Regarding the library to use, Zethos does not seem very active (no change in the last 3 years) : feel free to choose another one if you find a better one.
can I work on this issue?
@ciradu2204 You are of course welcome to work on the issue if it is of interest to you. See my comment above to Swayamsvk, and @mossroy's also below that.
Thank you, I will have a look at them
Can I also try tackling this?
Since there was no update on this for about a month, I though I could do it.
There's a speed read button which pops up a new window as shown in the video. The text is extracted from the articleContent element using the innerText property. It is then split on whitespaces. (Very rudimentary but I think it can improved by some good regex).
The core logic behind the display was not that hard so I built it myself instead of using the library.
There's a small bug too that I discovered while trying to detect if the content is an article or not. Pressing home button results in the isLandingPage property to toggle correctly but if we reach home by using history then the property still remains false since it is not updated during the transitions.
Awaiting comments, thanks!
Attached demo: https://drive.google.com/file/d/1SGyNwgKmsYczT25Hv8cmGQiZz4rrLOfv/view?usp=sharing
@bhargeymehta That looks very cool! Are you ready to post your code to this GitHub as a PR? When you are, you should go ahead and do so. Before you do, check that you have made this work both in jQuery mode and in Service Worker mode. To test in SW mode, you will need to run it from a webserver (localhost) rather than from file:// .
Also, thanks for reporting the isLandingPage bug. I found that a week or so ago in Kiwix JS Windows, but forgot to report it upstream here. Can you open a new issue for that? (I don't think transitions are the place to fix it though.)
@Jaifroid Created an issue for the landingPage problem: (https://github.com/kiwix/kiwix-js/issues/615) Also made a pull request for the speed read feature: (https://github.com/kiwix/kiwix-js/pull/616)
OK, great, thanks! Don't worry about the Travis failure: it's because you don't have write access to the repo. As part of testing, in due course, I'll push a cloned branch, which will allow the tests to run.
We tried this, but I don't believe we found it useful.