garethrees / readingtime Goto Github PK
View Code? Open in Web Editor NEWEstimates reading time
Home Page: http://github.com/garethrees/readingtime
License: MIT License
Estimates reading time
Home Page: http://github.com/garethrees/readingtime
License: MIT License
Disclaimer: I am a newbie to Rails.
I am wondering how to get readingtime to work with Action Text. I have had readingtime set up and running but once I have implemented the Action Text I am getting the following error:
NoMethodError at /articles/how-are-things
undefined method `reading_time' for #<ActionText::RichText:0x00007fb5a7be63b0>
Random idea. Might be nice to pass in the 200 average words per minute as an option?
Average readers
@article.body.reading_time :format => :basic, :wpm 200
For fast readers
@article.body.reading_time :format => :basic, :wpm 300
This is tops but I only really want reading time to be displayed in minutes, a reading time of 4 minutes 58 seconds is too accurate, particularly as reading time will vary by person.
Would very much like something like:
input.reading_time :format => :approx
or similar if possible, I will try and do a PR if I get chance...
Wanted to implement this in #2 but I had some problems (due to my awful ruby) so left it out. Would be useful to run the results through a pluralize method though to minute(s) and second(s) is displayed accurately.
Am using this for my blog, and the it's extremely unlikely that a post will be less than 1 minute so not urgent, but would be nice to have :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.