Skip to main content

mkdocs-timetoread-zh

mkdocs-timetoread-zh is a fork of @ntt4's mkdocs-timetoread-plugin with multiple language support.

Setup

Install the plugin using pip:

pip install mkdocs-timetoread-zh

Activate the plugin in mkdocs.yml:

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

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.

# Disable timetoread on a per file basis if `allPages` is set to True
timetoread: False
# 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.

Release files for mkdocs-timetoread-zh 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-timetoread-zh 0.2.0
File Size Uploaded
mkdocs_timetoread_zh-0.2.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-timetoread-zh 0.2.0
File Interpreter ABI Platform
mkdocs_timetoread_zh-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / mkdocs_timetoread_zh-0.2.0.tar.gz

Download URL mkdocs_timetoread_zh-0.2.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1277057a3bbfb840fc9b7ab05c8620ebfe923df76e61da6a3301d0163ad9fc82
BLAKE2b-256 checksum
How to use checksums
34a04650c934183235e962ee74b194af368751009dac51f7778ee6dfb6fa4834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Darwin/23.6.0

Release files / mkdocs_timetoread_zh-0.2.0-py3-none-any.whl

Download URL mkdocs_timetoread_zh-0.2.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a1890c3b3a4b5e78b443f65c9bffa1fe2bb578a4afd81469eb9a7f503d8853d
BLAKE2b-256 checksum
How to use checksums
54062edc378de6209da9ace37b3d4a30f959b9300070b1abcb42cb87c029d8f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page