Ember-cli-reading-time
This is a wip implementation for the nice reading-time (Michael Lynch) plugin to display estimated reading time a piece of text.
Installation
Run
npm install --save-dev 'ember-cli-reading-time'
ember generate ember-cli-reading-time
Add in your handlebar template
<article>
{{reading-time textTarget='article'}}
</article>
Options
-
readingTimeTarget: "id / class / element"
A string that defines the ID, class or element that will store the estimated reading time (default: 'eta'). - wordCountTarget: "id / class / element"
A string that defines the ID, class or element that will store the total word count (default: ''). - remotePath: "path"
A string that indicates the path to the remote file (default: null). - remoteTarget: "id / class / element"
A string that defines the ID, class or element in the remote file that contains the text in which you want to estimate the reading time of (default: null). - wordsPerMinute: integer
An integer that defines the words per minute at which to calculate the estimated reading time (default: 270). - round: boolean
A boolean value that indicates whether or not the estimated reading time should be rounded to the closest minute (default: true). - lang: "en / fr / de / es / nl"
A two letter string that indicates the language to be used (default: "en"). - lessThanAMinuteString: string
A string that changes the default "Less than a minute" copy (default: ''). - prependTimeString: string
A string that is prepended before the estimated reading time (default: ''). - prependWordString: string
A string that is prepended before the total word count (default: '').
Contributing
As this is a wip, please post new issues, feature request or even make pull requests
Running Tests
ember test
ember test --server