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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 101c1828dc5fe466819376a570327368e421dbdc9eefa31c9aedb660cab479db
4
- data.tar.gz: eb71b1ebbea0819e97c3915b1cadc65f8bf40b91ed83f384cacdddd1e9a16a15
3
+ metadata.gz: 92456e75fe83decb704532f8c4ddb362129d20c299111094d0b06ed727c61479
4
+ data.tar.gz: ddd2b1de3bc8248f83ca875c5289a07850c1176f01ac76223553ba1bc1114378
5
5
  SHA512:
6
- metadata.gz: 1d85579396ffdebe35a4c69c0e028acda18ff53a0d9c60eb56873a72a4ab3616ab7bcd718f22783fa807deb23774efade5657465e1292ced22afdd00421a6e51
7
- data.tar.gz: bfbb20f9b579c5112f96cfb26d25880b14e05cf5784c45f43180c9bf4dd72b4a705f4adb76bf4813a1770388df4b87ffef096ea0819d50bc7eb9555893f7706d
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 liqid tags in the url field. ([#3](https://github.com/erikw/jekyll-glossary_tooltip/issues/3])
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
  [![Gem Version](https://badge.fury.io/rb/jekyll-glossary_tooltip.svg)](https://badge.fury.io/rb/jekyll-glossary_tooltip)
3
3
  [![Gem Downloads](https://img.shields.io/gem/dt/jekyll-glossary_tooltip?label=gem%20downloads)](https://rubygems.org/gems/jekyll-glossary_tooltip)
4
4
  [![Travis Build Status](https://img.shields.io/travis/com/erikw/jekyll-glossary_tooltip/main?logo=travis)](https://app.travis-ci.com/github/erikw/jekyll-glossary_tooltip)
5
+ [![pages-build-deployment](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/pages/pages-build-deployment)
5
6
  [![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/7ffb648ec4b77f3f9eb8/maintainability)](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/maintainability)
6
7
  [![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/7ffb648ec4b77f3f9eb8/test_coverage)](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/test_coverage)
7
8
  [![CodeQL](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/codeql-analysis.yml/badge.svg)](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
- :point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/
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
- **Note** that a term name can not contain a `,`, as this is the argument separator character.
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
- #{@opts[:display]}
21
- <span class="jekyll-glossary-tooltip">#{entry["definition"]}#{render_tooltip_url(entry, context)}</span>
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", "")
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module GlossaryTooltip
5
- VERSION = "1.5.1"
5
+ VERSION = "2.0.0"
6
6
  end
7
7
  end
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: 1.5.1
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-10 00:00:00.000000000 Z
11
+ date: 2025-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll