jekyll-glossary_tooltip 1.5.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +16 -2
- data/lib/jekyll-glossary_tooltip/jekyll-glossary_tooltip.css +9 -0
- data/lib/jekyll-glossary_tooltip/tag.rb +4 -2
- data/lib/jekyll-glossary_tooltip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92456e75fe83decb704532f8c4ddb362129d20c299111094d0b06ed727c61479
|
4
|
+
data.tar.gz: ddd2b1de3bc8248f83ca875c5289a07850c1176f01ac76223553ba1bc1114378
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00b5b9b3cdf100a028e6fe0357d530e4abf8bb8b41bfd45cad776f8727abe7d4cb764d9d76a11bb7e6ddff0168d43f066457e94077a0df7653a8252f6c10042
|
7
|
+
data.tar.gz: 24112ba2028fc06ec8e754944a52fa1b8b295469323568d2eda5c92da64988e244592de514393cc1445b62ff7be2e831cd5944e957e44f77cda73cab8b79882f
|
data/CHANGELOG.md
CHANGED
@@ -5,13 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
|
+
|
9
|
+
## [2.0.0] - 2025-03-31
|
10
|
+
### Added
|
11
|
+
- [BREAKING] Hidden with CSS parenthesis around term definition. These parenthesis will be revealed when jekyll produces a post.except as typically HTML and CSS stripped => the plain text rendering of the glossary tag will be "<term-name> (term-description> <term-url>)". [#7](https://github.com/erikw/jekyll-glossary_tooltip/issues/7)
|
12
|
+
- To **upgrade** to new version, you need to update the CSS by re-copy the full contexts of [jekyll-glossary_tooltip.css](lib/jekyll-glossary_tooltip/jekyll-glossary_tooltip.css) to your side. The new CSS class `.jekyll-glossary-tooltip-hidden` is added and needed to hide parenthesis in the tooltip.
|
13
|
+
|
8
14
|
## [1.5.1] - 2025-03-10
|
9
15
|
### Fixed
|
10
16
|
- Strip newlines from generated HTML to prevent unnecessary spaces to be added. [#9](https://github.com/erikw/jekyll-glossary_tooltip/issues/9)
|
11
17
|
|
12
18
|
## [1.5.0] - 2022-09-08
|
13
19
|
### Added
|
14
|
-
- Support for embedded
|
20
|
+
- Support for embedded liquid tags in the url field. ([#3](https://github.com/erikw/jekyll-glossary_tooltip/issues/3])
|
15
21
|
|
16
22
|
## [1.4.0] - 2021-08-18
|
17
23
|
### Changed
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
[](https://badge.fury.io/rb/jekyll-glossary_tooltip)
|
3
3
|
[](https://rubygems.org/gems/jekyll-glossary_tooltip)
|
4
4
|
[](https://app.travis-ci.com/github/erikw/jekyll-glossary_tooltip)
|
5
|
+
[](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/pages/pages-build-deployment)
|
5
6
|
[](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/maintainability)
|
6
7
|
[](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/test_coverage)
|
7
8
|
[](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/codeql-analysis.yml)
|
@@ -16,7 +17,9 @@
|
|
16
17
|
<a href="https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=390309485" title="Open in GitHub Codespaces" ><img alt="Open in GitHub Codespaces" src="https://github.com/codespaces/badge.svg"></a>
|
17
18
|
</p>
|
18
19
|
|
19
|
-
|
20
|
+
> [!TIP]
|
21
|
+
> :point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/
|
22
|
+
|
20
23
|
|
21
24
|
<img src="/img/tooltip_screenshot.png" width="256" align="right" alt="Screenshot of the glossary tooltip term definition" title="Example of tooltip definition of the term 'Jekyll'.">
|
22
25
|
|
@@ -101,13 +104,24 @@ This could be e.g.
|
|
101
104
|
{% glossary some term, display: some other display text %}
|
102
105
|
```
|
103
106
|
|
104
|
-
|
107
|
+
> [!WARNING]
|
108
|
+
> A term name can not contain a `,`, as this is the argument separator character.
|
105
109
|
|
106
110
|
|
107
111
|
## CSS Style Override
|
108
112
|
Simply modify the rules [jekyll-glossary_tooltip.css](lib/jekyll-glossary_tooltip/jekyll-glossary_tooltip.css) that you copied to your project. The tooltip is based on this [tutorial](https://www.w3schools.com/css/css_tooltip.asp). View the generated HTML output to see the HTML tags that are styled, or check the [tag.rb](lib/jekyll-glossary_tooltip/tag.rb) implementation in the method `render()`.
|
109
113
|
|
110
114
|
|
115
|
+
## Page listing all terms
|
116
|
+
Thanks to this user submitted [idea](https://github.com/erikw/jekyll-glossary_tooltip/issues/6) we have a way to create a page listing all terms with defintions and URLs.
|
117
|
+
|
118
|
+
:point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/glossary.html
|
119
|
+
|
120
|
+
Steps:
|
121
|
+
1. Install [jekyll-liquify](https://github.com/gemfarmer/jekyll-liquify) to your site according to its README instructions.
|
122
|
+
1. Create a new page in your site similar to [glossary.md](https://github.com/erikw/jekyll-glossary_tooltip/blob/gh-pages-source/glossary.md?plain=1)
|
123
|
+
1. Build your site and access your new page listing all terms!
|
124
|
+
|
111
125
|
# Development
|
112
126
|
The structure of this plugin was inspired by [https://ayastreb.me/writing-a-jekyll-plugin/](https://ayastreb.me/writing-a-jekyll-plugin/), the plugin jekyll-sitemap and the [Bundler Gem tutorial](https://bundler.io/guides/creating_gem.html).
|
113
127
|
|
@@ -57,3 +57,12 @@
|
|
57
57
|
.jekyll-glossary:hover .jekyll-glossary-tooltip {
|
58
58
|
opacity: 1;
|
59
59
|
}
|
60
|
+
|
61
|
+
/* HACK: hide surrounding parenthesis on definition. When Jekyll renders
|
62
|
+
* post.excerpt, all HTML and CSS is stripped. The effect is that the extra
|
63
|
+
* parenthesis that are added are hidden in the normal blog post with hoover, but
|
64
|
+
* hidden in the post.except when html and css is stripped. Ref:
|
65
|
+
* https://github.com/erikw/jekyll-glossary_tooltip/issues/7#issuecomment-2711471867 */
|
66
|
+
.jekyll-glossary-tooltip-hidden {
|
67
|
+
display: none;
|
68
|
+
}
|
@@ -17,8 +17,10 @@ module Jekyll
|
|
17
17
|
@opts[:display] ||= @opts[:term_query]
|
18
18
|
html = <<~HTML
|
19
19
|
<span class="jekyll-glossary">
|
20
|
-
|
21
|
-
|
20
|
+
#{@opts[:display]}
|
21
|
+
<span class="jekyll-glossary-tooltip">
|
22
|
+
<span class="jekyll-glossary-tooltip-hidden">(</span>#{entry["definition"]}#{render_tooltip_url(entry, context)}<span class="jekyll-glossary-tooltip-hidden">)</span>
|
23
|
+
</span>
|
22
24
|
</span>
|
23
25
|
HTML
|
24
26
|
html.gsub("\n", "")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-glossary_tooltip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Westrup
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|