metalsmith-word-count0.0.4 • Public • Published
Metalsmith plugin to compute wordcount / average reading time of all paragraphs in a html file.
As part the my note "Extracting libs from a node.js project: Publishing my metalsmith plugins".
npm install --save metalsmith-word-count
var Metalsmith = ;var wordcount = ;// html files are available (e.g. state when markdown was compiled)// ...
Should also work in similar fashion with the
wordcount accepts an hash to provide a few customization options.
String: Name of the key that will store the word count in a file's metadata.
String: Name of the key that will store the estimated reading time in a file's metadata.
int: How fast one normally reads, see http://onforb.es/1crk3KF
bool: If readingTime should be outputted in seconds
bool: If readingTime should be returned as raw integer (in minutes or seconds)
Full example with options set
// html files are available (e.g. state when markdown was compiled)// ...
File an issue or fork 'n' fix and send a pull request.
(c) 2014 Mario Ranftl