# mkdocs-timetoread-zh
mkdocs-timetoread-zh is a fork of @ntt4's [mkdocs-timetoread-plugin](https://github.com/ntt4/mkdocs-timetoread-plugin) with multiple language support.
## Setup
Install the plugin using pip:
`pip install mkdocs-timetoread-zh`
Activate the plugin in `mkdocs.yml`:
```yaml
plugins:
- search
- timetoread-zh
```
> **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`
* `language` - Sets the language for the reading time message.
* Default value is `en`
* Possible values: `en`, `zh`
* `textColor` - Sets the CSS color for styling the 'Estimated read time:' text.
* Default value is `bdbdbd`
* Possible value range: `000000` - `ffffff`
* `template` - Sets the template for the reading time message.
* Default value is `Estimated read time: {minutes} minutes`
* Possible values: `Estimated read time: {minutes} minutes`, `预计阅读时长: {minutes} 分钟`
* `min_time` - Sets the minimum time for the reading time message to be displayed.
* Default value is `1`
* Possible value range: `1` - `999` (minutes)
* `round_method` - Sets the method for rounding the reading time.
* Default value is `ceil`
* Possible values: `ceil`, `floor`, `round`
* `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`
### Example Configuration
```yaml
plugins:
- timetoread-zh:
wpm: 300
language: "zh"
textColor: "666666"
template: "阅读时间:{minutes}分钟"
min_time: 1
round_method: "ceil"
```
## 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
```
## Usage
Once activated `mkdocs-timetoread-zh` will automatically add a new line, with the estimated time to read the document, after the `</h1>` tag in the HTML output generated by MkDocs.
Raw data
{
"_id": null,
"home_page": "https://github.com/libukai/mkdocs-timetoread-zh",
"name": "mkdocs-timetoread-zh",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "mkdocs, plugin, readtime, chinese",
"author": "Libukai",
"author_email": "xiaobuyao@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/34/a0/4650c934183235e962ee74b194af368751009dac51f7778ee6dfb6fa4834/mkdocs_timetoread_zh-0.2.0.tar.gz",
"platform": null,
"description": "# mkdocs-timetoread-zh\n\nmkdocs-timetoread-zh is a fork of @ntt4's [mkdocs-timetoread-plugin](https://github.com/ntt4/mkdocs-timetoread-plugin) with multiple language support.\n\n## Setup\n\nInstall the plugin using pip:\n\n`pip install mkdocs-timetoread-zh`\n\nActivate the plugin in `mkdocs.yml`:\n\n```yaml\nplugins:\n - search\n - timetoread-zh\n```\n\n> **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.\n\n## mkdocs.yml Configuration\n\n* `wpm` - Sets the 'words per minute' value for calculating estimated read time.\n * Default value is `255`\n * Possible value range: `1` - `999`\n\n* `language` - Sets the language for the reading time message.\n * Default value is `en`\n * Possible values: `en`, `zh`\n\n* `textColor` - Sets the CSS color for styling the 'Estimated read time:' text.\n * Default value is `bdbdbd`\n * Possible value range: `000000` - `ffffff`\n\n* `template` - Sets the template for the reading time message.\n * Default value is `Estimated read time: {minutes} minutes`\n * Possible values: `Estimated read time: {minutes} minutes`, `\u9884\u8ba1\u9605\u8bfb\u65f6\u957f: {minutes} \u5206\u949f`\n\n* `min_time` - Sets the minimum time for the reading time message to be displayed.\n * Default value is `1`\n * Possible value range: `1` - `999` (minutes)\n\n* `round_method` - Sets the method for rounding the reading time.\n * Default value is `ceil`\n * Possible values: `ceil`, `floor`, `round`\n\n* `allPages` - Sets all markdown files to have their read times' calculated unless explicitly disabled in the files' Front Matter.\n * Default value is `True`\n * Possible values: `True` or `False`\n\n### Example Configuration\n\n```yaml\nplugins:\n - timetoread-zh:\n wpm: 300\n language: \"zh\"\n textColor: \"666666\"\n template: \"\u9605\u8bfb\u65f6\u95f4\uff1a{minutes}\u5206\u949f\"\n min_time: 1\n round_method: \"ceil\"\n```\n\n## Front Matter\n\nOther configuration options are available by defining the following in a YAML front matter block in each markdown file.\n\n```yaml\n# Disable timetoread on a per file basis if `allPages` is set to True\ntimetoread: False\n```\n\n```yaml\n# Enable timetoread on a per file basis if `allPages` is set to False\ntimetoread: True\n```\n\n## Usage\n\nOnce activated `mkdocs-timetoread-zh` will automatically add a new line, with the estimated time to read the document, after the `</h1>` tag in the HTML output generated by MkDocs.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Estimated Time To Read generator for MkDocs with multiple language support",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/libukai/mkdocs-timetoread-zh",
"Repository": "https://github.com/libukai/mkdocs-timetoread-zh"
},
"split_keywords": [
"mkdocs",
" plugin",
" readtime",
" chinese"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "54062edc378de6209da9ace37b3d4a30f959b9300070b1abcb42cb87c029d8f2",
"md5": "88fbeb2379c32fcf6242e3b12194cac3",
"sha256": "3a1890c3b3a4b5e78b443f65c9bffa1fe2bb578a4afd81469eb9a7f503d8853d"
},
"downloads": -1,
"filename": "mkdocs_timetoread_zh-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "88fbeb2379c32fcf6242e3b12194cac3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 5442,
"upload_time": "2024-11-15T06:36:57",
"upload_time_iso_8601": "2024-11-15T06:36:57.058859Z",
"url": "https://files.pythonhosted.org/packages/54/06/2edc378de6209da9ace37b3d4a30f959b9300070b1abcb42cb87c029d8f2/mkdocs_timetoread_zh-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "34a04650c934183235e962ee74b194af368751009dac51f7778ee6dfb6fa4834",
"md5": "3f49ebb08daaf5e0403a0a3357e18191",
"sha256": "1277057a3bbfb840fc9b7ab05c8620ebfe923df76e61da6a3301d0163ad9fc82"
},
"downloads": -1,
"filename": "mkdocs_timetoread_zh-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3f49ebb08daaf5e0403a0a3357e18191",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 4419,
"upload_time": "2024-11-15T06:36:58",
"upload_time_iso_8601": "2024-11-15T06:36:58.708078Z",
"url": "https://files.pythonhosted.org/packages/34/a0/4650c934183235e962ee74b194af368751009dac51f7778ee6dfb6fa4834/mkdocs_timetoread_zh-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 06:36:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "libukai",
"github_project": "mkdocs-timetoread-zh",
"github_not_found": true,
"lcname": "mkdocs-timetoread-zh"
}