0.2.3 • Published 10 months ago

rspress-plugin-abbr-tooltip v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

rspress-plugin-abbr-tooltip NPM Version

And it will be rendered as:

Usage

npm i rspress-plugin-abbr-tooltip
pnpm add rspress-plugin-abbr-tooltip
import * as path from "path";
import { defineConfig } from "rspress/config";
import { pluginAbbreviate } from "rspress-plugin-abbr-tooltip";

export default defineConfig({
  root: path.join(__dirname, "docs"),
  plugins: [
    pluginAbbreviate({
      DOM: "Document Object Model",
    }),
  ],
});

Configure

Patterns

The matchers parameter uses the micromatch library with POSIX bracket expressions. Each pattern matcher includes:

pattern: A regular expression pattern using POSIX-style brackets to match different abbreviation formats.parser: A function to process each match, allowing custom transformations to retrieve the core abbreviation.

import * as path from "path";
import { defineConfig } from "rspress/config";
import { pluginAbbreviate } from "rspress-plugin-abbr-tooltip";

export default defineConfig({
  root: path.join(__dirname, "docs"),
  plugins: [
    pluginAbbreviate(
      {
        DOM: "Document Object Model",
      },
      [
        {
          // UUID. => UUID (.|,|@...)
          pattern: "[[:alpha:]]+[[:punct:]]",
          parser: (text) => text.slice(0, -1),
        },
      ]
    ),
  ],
});
0.2.1

10 months ago

0.2.0

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.1.4

10 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago