{"id":20974113,"url":"https://github.com/rcasto/readability-component","last_synced_at":"2025-12-28T13:53:27.198Z","repository":{"id":40768934,"uuid":"229645234","full_name":"rcasto/readability-component","owner":"rcasto","description":"A web component that calculates the readability and average reading time of text it encapsulates","archived":false,"fork":false,"pushed_at":"2023-01-06T02:22:28.000Z","size":3553,"stargazers_count":0,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T06:13:32.466Z","etag":null,"topics":["readability","readability-level","web-component"],"latest_commit_sha":null,"homepage":"https://rcasto.github.io/readability-component/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcasto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-22T23:38:18.000Z","updated_at":"2020-07-21T20:57:15.000Z","dependencies_parsed_at":"2023-02-05T03:01:16.250Z","dependency_job_id":null,"html_url":"https://github.com/rcasto/readability-component","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcasto%2Freadability-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcasto%2Freadability-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcasto%2Freadability-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcasto%2Freadability-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcasto","download_url":"https://codeload.github.com/rcasto/readability-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243374210,"owners_count":20280657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["readability","readability-level","web-component"],"created_at":"2024-11-19T04:26:39.461Z","updated_at":"2025-12-28T13:53:27.162Z","avatar_url":"https://github.com/rcasto.png","language":"JavaScript","readme":"# Readability Web Component\nA web component that can be used to wrap around your text content and determine its readability level, as well as the average time it would take to read.\n\nTo determine the readability level the [Flesch Kincaid readability test](https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests) is used.\n\nTo determine the average time to read the content, an average reading speed of 180 words per minute is used.\n\n**Note:** A heuristic is utilized to determine the number of syllables in a word, so the readability level may not be exactly what it would be if you were to manually calculate it, but it should not be terribly far off.\n\n[Try it out! (codepen)](https://codepen.io/rcasto/pen/gOaxjKM)\n\n## Usage\n\n### Via script tag\n```html\n\u003chtml\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n  \u003ctitle\u003eReadability Web Component\u003c/title\u003e\n  \u003cstyle\u003e\n    read-ability {\n      /* Allow customization of some of the Web components styling via\n      CSS properties */\n      --readability-margin: 0 0 16px 0;\n      --readability-font-size: 0.8em;\n      --readability-font-weight: lighter;\n      --readability-opacity: 0.8;\n      --readability-spacer-margin: 0 6px;\n      --readability-justify-content: center;\n    }\n  \u003c/style\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cread-ability\u003e\n    \u003c!-- This can be anything, this is your content --\u003e\n    \u003c!-- Make sure to add slot=\"readable-text\" attribute to your content if you also want it to be rendered --\u003e\n    \u003c!-- If you neglect to add the slot, then the readability of any text contained by the component is computed, without displaying it --\u003e\n    \u003cdiv id=\"text-content\" slot=\"readable-text\"\u003e\u003c/div\u003e\n  \u003c/read-ability\u003e\n\n  \u003c!-- Include script on your page --\u003e\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/readability-component@1.0.9/dist/readability.min.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Via module bundler\n1. Install package via package manager of your choice.\n```\nnpm install readability-component\n```\n\n2. `import 'readability-component'` as part of your app module, it should then be included as part of your bundle.\n```javascript\nimport 'readability-component';\n\n// Rest of your code...\n```\n\n3. You can now use `\u003cread-ability\u003e\u003c/read-ability\u003e` in your app views!\n\n## Resources\n- https://www.howmanysyllables.com/howtocountsyllables\n- https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch%E2%80%93Kincaid_grade_level\n- https://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcasto%2Freadability-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcasto%2Freadability-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcasto%2Freadability-component/lists"}