This library aims to give as accurate an estimate of the read time for an article in HTML or Markdown.
You can install the package from nuget
Install-Package ReadTimeEstimator
or
dotnet add package ReadTimeEstimator
or for paket
paket add ReadTimeEstimator
This package provided two estimators, one for HTML and one for Markdown, HtmlEstimator
and MarkdownEstimator
respectively. On each estimator, two methods are provided for retrieving the time estimates. ReadTimeInMinutes
returns a double
value which is the estimated read time in minutes. HumanFriendlyReadTime
returns a string
which is the read time in human friendly form.
A classic usage example:
using ReadTimeEstimator.Implementations.Estimators;
...
var htmlEstimator = new HtmlEstimator();
var markdownEstimator = new MarkdownEstimator();
var htmlReadTime = htmlEstimator.ReadTimeInMinutes("<div>Hello World</div>"); // 0.00727
var markdownReadTime = markdownEstimator.HumanFriendlyReadTime("# Hello World"); // less than a minute