Get started with readability CDN
Apache-2.0 licensed
A readability library in JS, such as Fog of War or TextBlob, analyzes the complexity of text to assess its ease of comprehension, providing a readability score.
Tags:- readability
Stable version
Copied!
How to start using readability CDN
// Include the Readability.js library from the CDN
const script = document.createElement('script');
script.src = 'https://cdn.cdnhub.io/readability/0.5.0/Readability.js';
document.head.appendChild(script);
// Wait for the library to load
Promise.all([new Promise(resolve => {
script.onload = () => {
resolve();
};
})])
.then(() => {
// Your text content
const textContent = document.querySelector('#textContent').textContent;
// Analyze readability
Readability.parse(textContent, (err, result) => {
if (err) {
console.error('Error parsing text:', err);
} else {
console.log('Flesch-Kincaid Grade Level:', result.FleschKincaidGradeLevel);
console.log('Gunning Fog Index:', result.GunningFogIndex);
}
});
});
Copied!
Copied!
Copied!
Copied!