Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ntt4/mkdocs-timetoread-plugin
A lightweight 'estimated time to read' generator for MkDocs
https://github.com/ntt4/mkdocs-timetoread-plugin
mkdocs mkdocs-plugin mkdocs-plugins
Last synced: 4 months ago
JSON representation
A lightweight 'estimated time to read' generator for MkDocs
- Host: GitHub
- URL: https://github.com/ntt4/mkdocs-timetoread-plugin
- Owner: ntt4
- License: mit
- Created: 2022-09-01T22:03:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-03T10:52:33.000Z (6 months ago)
- Last Synced: 2024-09-30T08:01:21.551Z (4 months ago)
- Topics: mkdocs, mkdocs-plugin, mkdocs-plugins
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mkdocs-timetoread-plugin
mkdocs-timetoread-plugin is a lightweight *'estimated time to read'* generator for MkDocs inspired by @alanhamlett's [readtime](https://github.com/alanhamlett/readtime) and Medium's [read time formula](https://help.medium.com/hc/en-us/articles/214991667-Read-time).
## Setup
Install the plugin using pip:
`pip install mkdocs-timetoread-plugin`
Activate the plugin in `mkdocs.yml`:
```yaml
plugins:
- search
- timetoread
```> **Note:** If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set, but now you have to enable it explicitly.
## mkdocs.yml Configuration* `wpm` - Sets the 'words per minute' value for calculating estimated read time.
* Default value is `255`
* Possible value range: `1` - `999`* `allPages` - Sets all markdown files to have their read times' calculated unless explicitly disabled in the files' Front Matter.
* Default value is `True`
* Possible values: `True` or `False`* `textColor` - Sets the CSS color for styling the 'Estimated read time:' text.
* Default value is `bdbdbd`
* Possible value range: `000000` - `ffffff`### Example Configuration
```yaml
plugins:
- timetoread:
wpm: 190
allPages: True
textColour: 000000
```## Front Matter
Other configuration options are available by defining the following in a YAML front matter block in each markdown file.
```yaml
// Disable timetoread on a per file basis if `allPages is set to True
timetoread: False
``````yaml
// Enable timetoread on a per file basis if `allPages` is set to False
timetoread: True
```
## UsageOnce activated `mkdocs-timetoread-plugin` will automatically add a new line, with the estimated time to read the document, after the `` tag in the HTML output generated by MkDocs.