0.3.0 • Published 1 month ago

rspress-plugin-reading-time v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

rspress-plugin-reading-time NPM Version

简体中文

Rspress plugin to display reading time for your document pages.

sample

Usage

npm i rspress-plugin-reading-time
pnpm add rspress-plugin-reading-time
import * as path from 'path';
import { defineConfig } from 'rspress/config';
import readingTime from 'rspress-plugin-reading-time';

export default defineConfig({
  root: path.join(__dirname, 'docs'),
  plugins: [readingTime()],
});

Configure

getReadingTime

Function to calculate estimated reading time, by default it uses reading-time package for estimation.

  • Type: (content: string) => ReadTimeResults

defaultLocale

Default locale for reading time, by default it uses en-US.

  • Type: string
import * as path from 'path';
import { defineConfig } from 'rspress/config';
import readingTime from 'rspress-plugin-reading-time';

export default defineConfig({
  root: path.join(__dirname, 'docs'),
  plugins: [
    readingTime({
      defaultLocale: 'zh-CN',
    }),
  ],
});
0.3.0

1 month ago

0.2.0

1 month ago

0.1.2-beta.0

1 month ago

0.1.1-beta.0

1 month ago

0.1.1

1 month ago

0.1.3

1 month ago

0.1.4-beta.0

1 month ago

0.1.3-beta.0

1 month ago

0.1.0

1 month ago