rspress-plugin-abbr-tooltip
v0.2.3
Published
And it will be rendered as:
Downloads
617
Readme
rspress-plugin-abbr-tooltip
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),
},
]
),
],
});