Skip to content

bolorundurowb/read-time-estimator

Repository files navigation

Read Time Estimator

Build status codecov License: MIT NuGet Badge

This library aims to give as accurate an estimate of the read time for an article in HTML or Markdown.

Installation

You can install the package from nuget

Install-Package ReadTimeEstimator

or

dotnet add package ReadTimeEstimator

or for paket

paket add ReadTimeEstimator

Usage

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

About

Estimate read times for HTML and Markdown articles

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages