
Front-end tooltip demo.
详情请查看:GitHub https://github.com/Simon-xuan/Wordnest
Wordnest is a minimalist glossary tooltip plugin built for WordPress. It automatically detects terms in your posts or pages and shows their definitions on hover, keyboard focus, or tap/click.
The frontend is intentionally small: pure CSS plus Vanilla JavaScript, with no jQuery and no third-party frontend dependencies. Wordnest is designed for documentation sites, course sites, knowledge bases, technical blogs, language-learning content, product documentation, and any WordPress site that needs to explain terms inside article content.
Term|Alias title format so multiple names share one definition.Many glossary and tooltip plugins are powerful, but they often load more frontend assets than small documentation or education sites need. Wordnest focuses on one job: explain terms inside content while staying lightweight, predictable, and easy to maintain.
Wordnest parses content with DOMDocument and rewrites text nodes instead of running a raw regex over HTML. This helps avoid corrupting tags, attributes, links, headings, and code examples.
Go to Glossary -> Add New Glossary Term.
|.Examples:
Phone
TV|Television
Go to Settings -> Wordnest -> Import and paste CSV text, one term per line:
ABC|John,John - Class 1
DEF|Jane,Jane - Class 2
Phone,A mobile phone
TV|Television,A television set
Existing terms with the same title are updated automatically rather than duplicated.
Tooltip styles live in assets/css/tooltip.css. You can edit the bubble background, text color, font size, spacing, border radius, focus outline, and responsive behavior there.
Example:
.wordnest-tooltip {
background-color: #333;
color: #fff;
border-radius: 4px;
font-size: 14px;
}
Wordnest is fully internationalized. The interface language follows your WordPress site language automatically.
languages/wordnest-en_US.mo.To add another language, use languages/wordnest.pot as the template, save the translation as wordnest-{locale}.po, compile it to .mo, and place it in languages/.
Wordnest 是一款专为 WordPress 打造的极简术语工具提示插件。它会自动识别文章或页面正文中的术语,并在鼠标悬停、键盘聚焦或触摸点击时显示释义。
前端使用纯 CSS + Vanilla JavaScript,无 jQuery、无第三方前端依赖。Wordnest 适合文档站、课程站、知识库、技术博客、语言学习内容、产品说明页,以及任何需要在正文中解释专业名词的 WordPress 站点。
术语|别名 标题格式,让多个名称共享同一释义。很多术语表或 tooltip 插件功能很全,但也会加载较重的前端资源。Wordnest 的目标更简单:只做一件事,把文章里的术语解释清楚,并尽量保持轻量、可控、易维护。
Wordnest 使用 DOMDocument 解析正文并改写文本节点,而不是直接对原始 HTML 跑正则。这能尽量避免破坏标签、属性、链接、标题和代码示例。
进入 词汇表 -> 添加新术语。
| 分隔别名。示例:
Phone
TV|Television
进入 设置 -> 轻量级词汇表 -> 导入,粘贴 CSV 文本,每行一条:
ABC|张三,张三 - 一班
DEF|李四,李四 - 二班
Phone,手机
TV|Television,电视
已存在的同名术语会自动更新,不会重复创建。
工具提示样式位于 assets/css/tooltip.css。你可以在这里调整气泡背景色、文字颜色、字号、间距、圆角、键盘焦点样式和响应式表现。
示例:
.wordnest-tooltip {
background-color: #333;
color: #fff;
border-radius: 4px;
font-size: 14px;
}
Wordnest 已完整国际化,界面语言会自动跟随 WordPress 站点语言。
languages/wordnest-en_US.mo。如需新增其他语言,可用 languages/wordnest.pot 作为模板,翻译后命名为 wordnest-{locale}.po,编译成 .mo 后放入 languages/。