Add estimated read time #687

Closed
opened 2026-02-04 21:51:31 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @mendiromania on GitHub (May 20, 2018).

Just a cool feature request, fit an estimated read time somewhere

Originally created by @mendiromania on GitHub (May 20, 2018). Just a cool feature request, fit an estimated read time somewhere
OVERLORD added the 🔨 Feature Request label 2026-02-04 21:51:31 +03:00
Author
Owner

@TBK commented on GitHub (Jun 2, 2018):

+1

Example:
image

Code example:
https://gist.github.com/mynameispj/3170442

@TBK commented on GitHub (Jun 2, 2018): +1 Example: ![image](https://user-images.githubusercontent.com/858296/40860948-76b70f18-65e7-11e8-9ccb-f676f8cf5906.png) Code example: https://gist.github.com/mynameispj/3170442
Author
Owner

@aljawaid commented on GitHub (Jul 29, 2018):

Not only cool but very useful guide too considering this is a book-type software which is designed for reading :)

@aljawaid commented on GitHub (Jul 29, 2018): Not only cool but very useful guide too considering this is a book-type software which is designed for reading :)
Author
Owner

@guillaumehanotel commented on GitHub (Jan 30, 2021):

Hi,
as mentioned in the PR #2514 , the lead dev isn't convinced of this feature. As he recommended it to me, I attach here a piece of code to put in the "Custom HTML Head Content" section in the settings. Feel free to adjust it at your own.

This will allow you to have an estimated time under the title of a page (cf this image)

<script type="text/javascript">

	function renderPageReadingTime() {
		const page = document.querySelector('.page-content');
		if(page !== null) {
			const pageTitle = page.getElementsByTagName('h1')[0];
			const pageContent = pageTitle.parentElement.innerText;
			const words = (pageContent.replace(/(<([^>]+)>)/gi, "")).split(' ').length;
			const readingTimeInMinute = Math.floor(words / 200);
			const readingTimeEl = document.createElement('p');
			readingTimeEl.appendChild(document.createTextNode(readingTimeInMinute + " min read"));
			pageTitle.after(readingTimeEl);
		}
	}
	
	setTimeout(renderPageReadingTime, 100);

</script>
@guillaumehanotel commented on GitHub (Jan 30, 2021): Hi, as mentioned in the PR #2514 , the lead dev isn't convinced of this feature. As he recommended it to me, I attach here a piece of code to put in the "Custom HTML Head Content" section in the settings. Feel free to adjust it at your own. This will allow you to have an estimated time under the title of a page (cf this [image](https://imgur.com/zo1t0eR)) ```javascript <script type="text/javascript"> function renderPageReadingTime() { const page = document.querySelector('.page-content'); if(page !== null) { const pageTitle = page.getElementsByTagName('h1')[0]; const pageContent = pageTitle.parentElement.innerText; const words = (pageContent.replace(/(<([^>]+)>)/gi, "")).split(' ').length; const readingTimeInMinute = Math.floor(words / 200); const readingTimeEl = document.createElement('p'); readingTimeEl.appendChild(document.createTextNode(readingTimeInMinute + " min read")); pageTitle.after(readingTimeEl); } } setTimeout(renderPageReadingTime, 100); </script> ```
Author
Owner

@ssddanbrown commented on GitHub (Nov 8, 2022):

There's been relatively little demand for this since opening so I'm going to close it off.
If desired, upon the above JS solution, this could also likely be added using our visual theme system.

@ssddanbrown commented on GitHub (Nov 8, 2022): There's been relatively little demand for this since opening so I'm going to close it off. If desired, upon the above JS solution, this could also likely be added using our [visual theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#687