ember-cli-reading-time

0.0.5 • Public • Published

Ember-cli-reading-time

Build Status

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

  1. readingTimeTarget: "id / class / element"
    A string that defines the ID, class or element that will store the estimated reading time (default: 'eta').
  2. wordCountTarget: "id / class / element"
    A string that defines the ID, class or element that will store the total word count (default: '').
  3. remotePath: "path"
    A string that indicates the path to the remote file (default: null).
  4. 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).
  5. wordsPerMinute: integer
    An integer that defines the words per minute at which to calculate the estimated reading time (default: 270).
  6. round: boolean
    A boolean value that indicates whether or not the estimated reading time should be rounded to the closest minute (default: true).
  7. lang: "en / fr / de / es / nl"
    A two letter string that indicates the language to be used (default: "en").
  8. lessThanAMinuteString: string
    A string that changes the default "Less than a minute" copy (default: '').
  9. prependTimeString: string
    A string that is prepended before the estimated reading time (default: '').
  10. 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

Package Sidebar

Install

npm i ember-cli-reading-time

Weekly Downloads

3

Version

0.0.5

License

MIT

Last publish

Collaborators

  • borisrorsvort