jekyll-glossary_tooltip 1.5.1 → 2.1.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: 91e6fca1d659df4ab67f4a9ef820714061537414e3abbe8f9a7c7dc6d38ae7b4
4
+ data.tar.gz: 8df03a1c8ce31c37f1515f48382b41cec4505d8642a543a0d3159f6dddd23da7
5
5
  SHA512:
6
- metadata.gz: 1d85579396ffdebe35a4c69c0e028acda18ff53a0d9c60eb56873a72a4ab3616ab7bcd718f22783fa807deb23774efade5657465e1292ced22afdd00421a6e51
7
- data.tar.gz: bfbb20f9b579c5112f96cfb26d25880b14e05cf5784c45f43180c9bf4dd72b4a705f4adb76bf4813a1770388df4b87ffef096ea0819d50bc7eb9555893f7706d
6
+ metadata.gz: 8bc49f67ef08dc212f0cea012a8c950952eacfd67c3e166d5c7312e0d4b402265e29ccbf98d5e01e2a7c538b5ea45d860e66a77d909f2041d43506810194b10b
7
+ data.tar.gz: 8da008c59ce1dc5c794e80423145254406350b2b0610ab8e0c927ed4b2dac139b7a7e74e53fb0167aef9bd583bb6a1555516a050c5d848247df2c5046dd3004f
@@ -0,0 +1,50 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: main
7
+ pull_request:
8
+ branches: main
9
+
10
+ # OIDC permissions for qlty
11
+ permissions:
12
+ contents: read
13
+ id-token: write
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+
19
+ strategy:
20
+ matrix:
21
+ ruby: [2.7.0, 3.0.1]
22
+ gemfile:
23
+ - gemfiles/jekyll_3.7.x.gemfile
24
+ - gemfiles/jekyll_4.x.x.gemfile
25
+
26
+ env:
27
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
28
+
29
+ steps:
30
+ - name: Checkout code
31
+ uses: actions/checkout@v4
32
+
33
+ - name: Set up Ruby
34
+ uses: ruby/setup-ruby@v1
35
+ with:
36
+ ruby-version: ${{ matrix.ruby }}
37
+ bundler-cache: true
38
+ bundler: 2.2.18
39
+
40
+ - name: Run tests
41
+ run: bundle exec rake spec
42
+
43
+ - name: Run linting
44
+ run: bundle exec rake rubocop
45
+
46
+ - uses: qltysh/qlty-action/coverage@v2
47
+ with:
48
+ oidc: true
49
+ format: simplecov
50
+ files: coverage/.resultset.json
data/.qlty/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ *
2
+ !configs
3
+ !configs/**
4
+ !hooks
5
+ !hooks/**
6
+ !qlty.toml
7
+ !.gitignore
@@ -0,0 +1 @@
1
+ source-path=SCRIPTDIR
data/.qlty/qlty.toml ADDED
@@ -0,0 +1,85 @@
1
+ # This file was automatically generated by `qlty init`.
2
+ # You can modify it to suit your needs.
3
+ # We recommend you to commit this file to your repository.
4
+ #
5
+ # This configuration is used by both Qlty CLI and Qlty Cloud.
6
+ #
7
+ # Qlty CLI -- Code quality toolkit for developers
8
+ # Qlty Cloud -- Fully automated Code Health Platform
9
+ #
10
+ # Try Qlty Cloud: https://qlty.sh
11
+ #
12
+ # For a guide to configuration, visit https://qlty.sh/d/config
13
+ # Or for a full reference, visit https://qlty.sh/d/qlty-toml
14
+ config_version = "0"
15
+
16
+ exclude_patterns = [
17
+ "*_min.*",
18
+ "*-min.*",
19
+ "*.min.*",
20
+ "**/.yarn/**",
21
+ "**/*.d.ts",
22
+ "**/assets/**",
23
+ "**/bower_components/**",
24
+ "**/build/**",
25
+ "**/cache/**",
26
+ "**/config/**",
27
+ "**/db/**",
28
+ "**/deps/**",
29
+ "**/dist/**",
30
+ "**/extern/**",
31
+ "**/external/**",
32
+ "**/generated/**",
33
+ "**/Godeps/**",
34
+ "**/gradlew/**",
35
+ "**/mvnw/**",
36
+ "**/node_modules/**",
37
+ "**/protos/**",
38
+ "**/seed/**",
39
+ "**/target/**",
40
+ "**/templates/**",
41
+ "**/testdata/**",
42
+ "**/vendor/**",
43
+ ]
44
+
45
+ test_patterns = [
46
+ "**/test/**",
47
+ "**/spec/**",
48
+ "**/*.test.*",
49
+ "**/*.spec.*",
50
+ "**/*_test.*",
51
+ "**/*_spec.*",
52
+ "**/test_*.*",
53
+ "**/spec_*.*",
54
+ ]
55
+
56
+ [smells]
57
+ mode = "comment"
58
+
59
+ [smells.boolean_logic]
60
+ threshold = 4
61
+
62
+ [smells.file_complexity]
63
+ threshold = 55
64
+
65
+ [smells.return_statements]
66
+ threshold = 4
67
+
68
+ [smells.nested_control_flow]
69
+ threshold = 4
70
+
71
+ [smells.function_parameters]
72
+ threshold = 4
73
+
74
+ [smells.function_complexity]
75
+ threshold = 5
76
+
77
+ [[source]]
78
+ name = "default"
79
+ default = true
80
+
81
+ [[plugin]]
82
+ name = "rubocop"
83
+ version = "1.80.2"
84
+ package_file = "Gemfile"
85
+ package_filters = ["rubocop"]
data/CHANGELOG.md CHANGED
@@ -5,13 +5,25 @@ 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.1.0] - 2025-10-30
10
+ ### Added
11
+ - Unicode support [#20](https://github.com/erikw/jekyll-glossary_tooltip/pull/20)
12
+ ### Changed
13
+ - Migrated CI from Travis to GitHub Actions.
14
+
15
+ ## [2.0.0] - 2025-03-31
16
+ ### Added
17
+ - [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)
18
+ - 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.
19
+
8
20
  ## [1.5.1] - 2025-03-10
9
21
  ### Fixed
10
22
  - Strip newlines from generated HTML to prevent unnecessary spaces to be added. [#9](https://github.com/erikw/jekyll-glossary_tooltip/issues/9)
11
23
 
12
24
  ## [1.5.0] - 2022-09-08
13
25
  ### Added
14
- - Support for embedded liqid tags in the url field. ([#3](https://github.com/erikw/jekyll-glossary_tooltip/issues/3])
26
+ - Support for embedded liquid tags in the url field. ([#3](https://github.com/erikw/jekyll-glossary_tooltip/issues/3])
15
27
 
16
28
  ## [1.4.0] - 2021-08-18
17
29
  ### Changed
data/CONTRIBUTING.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # How to contribute
2
2
  Please use GitHub tooling (issues, PRs) to disucssion and code contributions!
3
3
 
4
- When you open an PR, Travis will build your code, run tests, liters and so on.
4
+ When you open an PR, GitHub Actions will build your code, run tests, liters and so on.
data/Gemfile CHANGED
@@ -16,14 +16,13 @@ group :development, :test do
16
16
  gem "gem-release", "~> 2.0", require: false
17
17
  gem "rake", "~> 13.0", require: false
18
18
  gem "solargraph", require: false
19
- gem "travis", "~> 1.0", require: false
20
19
  end
21
20
 
22
21
  group :test do
22
+ gem "json_pure", "~> 2.8", require: false # Solargraph pulls in v2.6.3 which fails build with " uninitialized constant JSON::Fragment"
23
23
  gem "rspec", "~> 3.0"
24
24
  gem "rubocop", "~> 1.18", require: false
25
25
  gem "rubocop-rake", "~> 0.6", require: false
26
26
  gem "rubocop-rspec", "~> 3.5", require: false
27
27
  gem "simplecov", "~> 0.22"
28
- gem "json_pure", "~> 2.8", require: false # Solargraph pulls in v2.6.3 which fails build with " uninitialized constant JSON::Fragment"
29
28
  end
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
- # Jekyll Glossary Tooltip Tag Plugin [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Get%20a%20nifty%20tooltip%20for%20term%20definitions%20in%20your%20Jekyll%20blog%20with%20this%20plugin&url=https://github.com/erikw/jekyll-glossary_tooltip&via=erik_westrup&hashtags=jekyll,plugin)
1
+ # Jekyll Glossary Tooltip Tag Plugin [![Post on X](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://x.com/intent/tweet?text=Get%20a%20nifty%20tooltip%20for%20term%20definitions%20in%20your%20Jekyll%20blog%20with%20this%20plugin&url=https://github.com/erikw/jekyll-glossary_tooltip&via=erik_westrup&hashtags=jekyll,plugin)
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
- [![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
- [![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/7ffb648ec4b77f3f9eb8/maintainability)](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/maintainability)
6
- [![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/7ffb648ec4b77f3f9eb8/test_coverage)](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/test_coverage)
4
+ [![Continuous Integration](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/ci.yml/badge.svg)](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/ci.yml)
5
+ [![Continuous Deployment](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/cd.yml/badge.svg)](https://github.com/erikw/jekyll-glossary_tooltip/actions/workflows/cd.yml)
7
6
  [![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)
7
+ [![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)
8
+ [![Code Climate Maintainability](https://qlty.sh/gh/erikw/projects/jekyll-glossary_tooltip/maintainability)](https://qlty.sh/gh/erikw/projects/jekyll-glossary_tooltip)
9
+ [![Code Climate Test Coverage](https://qlty.sh/gh/erikw/projects/jekyll-glossary_tooltip/test_coverage)](https://qlty.sh/gh/erikw/projects/jekyll-glossary_tooltip)
8
10
  [![SLOC](https://sloc.xyz/github/erikw/jekyll-glossary_tooltip?lower=true)](#)
9
11
  [![Number of programming languages used](https://img.shields.io/github/languages/count/erikw/jekyll-glossary_tooltip)](#)
10
12
  [![Top programming languages used](https://img.shields.io/github/languages/top/erikw/jekyll-glossary_tooltip)](#)
@@ -16,13 +18,15 @@
16
18
  <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
19
  </p>
18
20
 
19
- :point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/
21
+ > [!TIP]
22
+ > :point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/
23
+
20
24
 
21
25
  <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
26
 
23
- This plugin simplifies for your readers and you by making it easy to define terms or abbreviations that needs an explanation. Define a common dictionary of terms and their definition in a YAML file. Then inside markdown files you can use the provided glossary liquid tag to insert a tooltip for a defined word from the dictionary. The tooltip will show the term definition on mouse hover.
27
+ This plugin simplifies things for your website visitors and you by making it easy to define terms or abbreviations that need an explanation. Define a common dictionary of terms and their definition in a YAML file. Then, inside the markdown file, you can use the provided glossary liquid tag to insert a tooltip for a defined word from the dictionary. The tooltip will show the term definition on mouse hover.
24
28
 
25
- It's also possible to provide an optional URL to for example a term definition source reference. To also support mobile devices, this URL link is placed inside the tooltip pop-up itself, rather than making the term itself clickable. This is so that on mobile device, you will first tap the word to get the hover tooltip, then click the link in the tooltip if desired.
29
+ It's also possible to provide an optional URL for, for example, a term definition source reference. To also support mobile devices, this URL link is placed inside the tooltip pop-up itself, rather than making the term itself clickable. This is so that on a mobile device, you will first tap the word to get the hover tooltip, then click the link in the tooltip if desired.
26
30
 
27
31
 
28
32
  # Installation
@@ -46,8 +50,8 @@ It's also possible to provide an optional URL to for example a term definition s
46
50
  ```
47
51
  1. Create a `_data/glossary.yml` file, according to the 'Glossary Term Definition File' section below, with your terms.
48
52
  1. Use the liquid tag in a page like `{% glossary term_name %}`
49
- 1. Add CSS styling for the tooltip from [jekyll-glossary_tooltip.css](lib/jekyll-glossary_tooltip/jekyll-glossary_tooltip.css). You need to make sure that the pages where you will use the glossary tag have this styling applied. Typically this would mean 1) copying this file to your `assets/css/` directory 2) editing your theme's template for blog posts (or what pages you desire) to include this CSS in the header like `<link rel="stylesheet" href="/assets/css/jekyll-glossary_tooltip.css">`. However you could also copy this file's content in to your `main.css` or `main.scss` or however you build your site's CSS.
50
- 1. Now just build your site and you will get nice nice term definition tooltips on mouse hover (or mobile, tap) for you terms!
53
+ 1. Add CSS styling for the tooltip from [jekyll-glossary_tooltip.css](lib/jekyll-glossary_tooltip/jekyll-glossary_tooltip.css). You need to make sure that the pages where you will use the glossary tag have this styling applied. Typically, this would mean 1) copying this file to your `assets/css/` directory, 2) editing your theme's template for blog posts (or what pages you desire) to include this CSS in the header like `<link rel="stylesheet" href="/assets/css/jekyll-glossary_tooltip.css">`. However, you could also copy this file's content into your `main.css` or `main.scss` or however you build your site's CSS.
54
+ 1. Now just build your site, and you will get nice, nice term definition tooltips on mouse hover (or mobile, tap) for your terms!
51
55
  ```shell
52
56
  bundle exec jekyll build
53
57
  ```
@@ -67,15 +71,15 @@ Create a file `_data/glossary.yml` to host your shared term definition entries.
67
71
  This could look something like:
68
72
  ```markdown
69
73
  - term: Jekyll
70
- definition: A Static Site Generator (SSG) built with ruby. Widely adopted as of GitHub Pages inclusion.
74
+ definition: A Static Site Generator (SSG) built with Ruby. Widely adopted as of GitHub Pages inclusion.
71
75
  url: https://jekyllrb.com/
72
76
  - term: SSG
73
- definition: A Static Site Generator compiles the website before deployment. Then the generated web content is simply retrieved as-is by the client without any code running at retrieve time.
77
+ definition: A Static Site Generator compiles the website before deployment. Then the generated web content is simply retrieved as-is by the client without any code running at retrieval time.
74
78
  - term: Jamstack
75
- definition: JavaScript + API + Markup - a way of buildin and hosting websites.
79
+ definition: JavaScript + API + Markup - a way of building and hosting websites.
76
80
  url: https://jamstack.org/
77
81
  - term: EmbeddedLiquidURL
78
- definition: This definition has an URL with embedded liquid tags to make it dynamic at build time. Note special YAML syntax for being able to use liquid (1.)
82
+ definition: This definition has a URL with embedded liquid tags to make it dynamic at build time. Note special YAML syntax for being able to use liquid (1.)
79
83
  url: >
80
84
  {{ site.baseurl }}{% link page2.md %}
81
85
  ```
@@ -84,35 +88,50 @@ This could look something like:
84
88
 
85
89
 
86
90
  ## Tag Usage
87
- On any page where you've made sure include the needed CSS styling, you can use the glossary tag simply like
91
+ On any page where you've made sure to include the needed CSS styling, you can use the glossary tag simply like
88
92
 
89
93
  ```markdown
90
94
  Here I'm talking about {% glossary term_name %} in a blog post.
91
95
 
92
96
  The term name can contain spaces like {% glossary operating system %}.
93
97
 
94
- Even if the term is defined in _data/glossary.yml as 'term_name', the matching is case-insensitive meaning that I can look it up using {% glossary TeRM_NaME %}. Note that the term is displayed as defined in the tag rather than the definition, here meaing 'TeRM_NaME'.
98
+ Even if the term is defined in _data/glossary.yml as 'term_name', the matching is case-insensitive
99
+ meaning that I can look it up using {% glossary TeRM_NaME %}. Note that the term is displayed as
100
+ defined in the tag rather than the definition, here meaning 'TeRM_NaME'.
95
101
 
96
- The case-styling above works as there's still a case-insensitive match. But what about when you actually want to dispaly the term differently? Maybe the term is defined as "cat" but you want to use the plural "cats"? Then you can supply an optional `display` argument. The syntax is:
102
+ The case-styling above works as there's still a case-insensitive match. But what about when you
103
+ actually want to display the term differently? Maybe the term is defined as "cat," but you want to
104
+ use the plural "cats"? Then you can supply an optional `display` argument. The syntax is:
97
105
  {% glossary <term>, display: <diplay name> %}
98
106
 
99
- This could be e.g.
107
+ This could be, e.g.
100
108
  {% glossary cat, display: cats %}
101
109
  {% glossary some term, display: some other display text %}
102
110
  ```
103
111
 
104
- **Note** that a term name can not contain a `,`, as this is the argument separator character.
112
+ > [!WARNING]
113
+ > A term name can not contain a `,`, as this is the argument separator character.
105
114
 
106
115
 
107
116
  ## CSS Style Override
108
117
  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
118
 
110
119
 
120
+ ## Page listing all terms
121
+ 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 definitions and URLs.
122
+
123
+ :point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/glossary.html
124
+
125
+ Steps:
126
+ 1. Install [jekyll-liquify](https://github.com/gemfarmer/jekyll-liquify) to your site according to its README instructions.
127
+ 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)
128
+ 1. Build your site and access your new page listing all terms!
129
+
111
130
  # Development
112
131
  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
132
 
114
133
  After checking out the repo;
115
- 1. Install [RVM](https://rvm.io/rvm/install) and install a supported ruby version (see .gemspec)
134
+ 1. Install [RVM](https://rvm.io/rvm/install) and install a supported Ruby version (see .gemspec)
116
135
  1. run `scripts/setup` to install dependencies
117
136
  1. run `scripts/test` to run the tests
118
137
  * Run a specific test with `bundle exec rspec -e "name of test example"`
@@ -131,13 +150,13 @@ Following the setup at [how-to-specify-local-ruby-gems-in-your-gemfile](https://
131
150
  1. Configure bundler to use a local path for this gem in this project:
132
151
  - `$ bundle config --local local.jekyll-glossary_tooltip ~/src/jekyll-glossary_tooltip`
133
152
  1. Update the project: `$ bundle install`
134
- 1. Now the project will build with the local clone of this plugin when issuing e.g. `bundle exec jekyll build`
153
+ 1. Now the project will build with the local clone of this plugin when issuing e.g., `bundle exec jekyll build`
135
154
  1. When you're done:
136
155
  - Remove the local override with: `$ bundle config --delete local.jekyll-glossary_tooltip`
137
- - Optionally restore the original gem include in `Gemfile` or keep building from a branch in the github repo.
156
+ - Optionally restore the original gem included in `Gemfile` or keep building from a branch in the GitHub repo.
138
157
 
139
158
  ## Releasing
140
- Instructions for releasing on rubygems.org below. Optionally make a GitHub [release](https://github.com/erikw/jekyll-glossary_tooltip/releases) after this for the pushed git tag.
159
+ Instructions for releasing on rubygems.org are below. Optionally make a GitHub [release](https://github.com/erikw/jekyll-glossary_tooltip/releases) after this for the pushed git tag.
141
160
 
142
161
  ## Using bundler/gem_tasks rake tasks
143
162
  Following instructions from [bundler.io](https://bundler.io/guides/creating_gem.html#releasing-the-gem):
@@ -152,16 +171,17 @@ gem install pkg/jekyll-glossary_tooltip-$ver.gem
152
171
  bundle exec rake release
153
172
  ```
154
173
 
155
- ## Using gem-release gem extension
174
+ ## [recommended] Using gem-release gem extension
156
175
  Using [gem-release](https://github.com/svenfuchs/gem-release):
157
176
  ```shell
158
177
  vi CHANGELOG.md && git add CHANGELOG.md && git commit -m "Update CHANGELOG.md" && git push
178
+ gem signin
159
179
  gem bump --version minor --tag --push --release --sign
160
180
  ```
161
181
  For `--version`, use `major|minor|patch` as needed.
162
182
 
163
183
  ## Multi-versions
164
- * For ruby, just use RVM to switch between supported ruby version specified in `.gemspec`.
184
+ * For Ruby, just use RVM to switch between supported Ruby versions specified in `.gemspec`.
165
185
  * To run with different jekyll versions, [Appraisal](https://github.com/thoughtbot/appraisal) is used with [`Appraisals`](Appraisals) to generate different [`gemfiles/`](gemfiles/)
166
186
  - To use a specific Gemfile, run like
167
187
  ```shell
@@ -178,29 +198,6 @@ For `--version`, use `major|minor|patch` as needed.
178
198
  bundle exec appraisal generate
179
199
  ```
180
200
 
181
- ## Travis
182
- To use the [travis cli client](https://github.com/travis-ci/travis.rb) (installed from `Gemfile`):
183
- 1. Get a GitHub OAuth token by
184
- - going to [github.com/settings/tokens](https://github.com/settings/tokens)
185
- - create a new token named `travis-cli`
186
- - Set the scopes `repo`, `read:org`, `user:email` according to the [docs](https://docs.travis-ci.com/user/github-oauth-scopes).
187
- 1. Set travis.com as the default so we don't need to add `--pro` to most commands
188
- ```shell
189
- bundle exec travis endpoint --set-default --api-endpoint https://api.travis-ci.com/
190
- ```
191
- 1. Login with the cli client
192
- ```shell
193
- bundle exec travis login --github-token $GITHUB_TOKEN
194
- ```
195
- 1. Now the cli client can be used (might need `--pro` to use travis.com)
196
- ```shell
197
- bundle exec travis lint
198
- bundle exec travis accounts
199
- bundle exec travis status
200
- bundle exec travis branches
201
- bundle exec travis monitor
202
- ```
203
-
204
201
  ## Live Demo GitHub Pages
205
202
  The live demo source is in the branch [`gh-pages-source`](https://github.com/erikw/jekyll-glossary_tooltip/tree/gh-pages-source). Check its `README.md`!
206
203
 
data/Rakefile CHANGED
@@ -13,7 +13,14 @@ RSpec::Core::RakeTask.new(:spec)
13
13
  require "rubocop/rake_task"
14
14
  RuboCop::RakeTask.new(:rubocop) do |t|
15
15
  # See https://docs.rubocop.org/rubocop/usage/basic_usage.html
16
- t.options = ['--display-cop-names', '--parallel']
16
+ t.options = ["--display-cop-names", "--parallel"]
17
+ end
18
+
19
+ desc "Run Qlty code analysis"
20
+ task :qlty do
21
+ sh "qlty smells --all"
22
+ sh "qlty metrics --all --max-depth=2 --sort complexity --limit 10"
23
+ # sh "qlty lint" # Just runs rubocop, not necessary as we have a task for this already
17
24
  end
18
25
 
19
26
  # default task: Add spec and rubocop to default tasks.
@@ -11,7 +11,6 @@ group :development, :test do
11
11
  gem "gem-release", "~> 2.0", require: false
12
12
  gem "rake", "~> 13.0", require: false
13
13
  gem "solargraph", require: false
14
- gem "travis", "~> 1.0", require: false
15
14
  end
16
15
 
17
16
  group :test do
@@ -9,7 +9,6 @@ group :development, :test do
9
9
  gem "gem-release", "~> 2.0", require: false
10
10
  gem "rake", "~> 13.0", require: false
11
11
  gem "solargraph", require: false
12
- gem "travis", "~> 1.0", require: false
13
12
  end
14
13
 
15
14
  group :test do
@@ -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
+ }
@@ -7,7 +7,7 @@ module Jekyll
7
7
  # Stripped down & modified version of
8
8
  # https://github.com/ayastreb/jekyll-maps/blob/master/lib/jekyll-maps/options_parser.rb
9
9
  class OptionsParser
10
- ARGS_PATTERN = %r{\s*(\w[-_\w]*):\s*(\w[^,\n\r]*)}
10
+ ARGS_PATTERN = %r{\s*([\p{L}_][-\p{L}_]*):\s*([\p{L}_][^,\n\r]*)}
11
11
  ARGS_ALLOWED = %w[
12
12
  display
13
13
  ].freeze
@@ -17,8 +17,8 @@ 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"><span class="jekyll-glossary-tooltip-hidden">(</span>#{entry["definition"]}#{render_tooltip_url(entry, context)}<span class="jekyll-glossary-tooltip-hidden">)</span></span>
22
22
  </span>
23
23
  HTML
24
24
  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.1.0"
6
6
  end
7
7
  end
data/scripts/setup CHANGED
@@ -6,3 +6,7 @@ set -vx
6
6
  rvm install ruby-$(cat .ruby-version)
7
7
  gem install bundler -v 2.2.18
8
8
  bundle install
9
+
10
+
11
+ # Qlty CLI tool. Ref: https://docs.qlty.sh/cli/quickstart
12
+ curl https://qlty.sh | sh
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.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Westrup
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-10 00:00:00.000000000 Z
11
+ date: 2025-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -47,13 +47,16 @@ files:
47
47
  - ".editorconfig"
48
48
  - ".github/dependabot.yml"
49
49
  - ".github/workflows/cd.yml"
50
+ - ".github/workflows/ci.yml"
50
51
  - ".github/workflows/codeql-analysis.yml"
51
52
  - ".gitignore"
53
+ - ".qlty/.gitignore"
54
+ - ".qlty/configs/.shellcheckrc"
55
+ - ".qlty/qlty.toml"
52
56
  - ".rspec"
53
57
  - ".rubocop.yml"
54
58
  - ".ruby-version"
55
59
  - ".simplecov"
56
- - ".travis.yml"
57
60
  - Appraisals
58
61
  - CHANGELOG.md
59
62
  - CONTRIBUTING.md
@@ -88,7 +91,7 @@ metadata:
88
91
  homepage_uri: https://github.com/erikw/jekyll-glossary_tooltip/
89
92
  source_code_uri: https://github.com/erikw/jekyll-glossary_tooltip/
90
93
  changelog_uri: https://github.com/erikw/jekyll-glossary_tooltip/blob/main/CHANGELOG.md
91
- post_install_message:
94
+ post_install_message:
92
95
  rdoc_options: []
93
96
  require_paths:
94
97
  - lib
@@ -106,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
109
  - !ruby/object:Gem::Version
107
110
  version: '0'
108
111
  requirements: []
109
- rubygems_version: 3.5.11
110
- signing_key:
112
+ rubygems_version: 3.3.3
113
+ signing_key:
111
114
  specification_version: 4
112
115
  summary: Jekyll plugin providing a glossary liquid tag that will show a tooltip of
113
116
  a term definition in your site.
data/.travis.yml DELETED
@@ -1,31 +0,0 @@
1
- # NOTE run $(travis lint) after modyifing this file.
2
-
3
- # Travis
4
- # - build lifecycle: https://docs.travis-ci.com/user/job-lifecycle
5
- # - config doc: https://config.travis-ci.com/
6
- # - ruby defaults: https://docs.travis-ci.com/user/languages/ruby/
7
- # Codeclimate setup: https://docs.codeclimate.com/docs/travis-ci-test-coverage
8
-
9
- version: ~> 1.0
10
- env:
11
- global:
12
- - CC_TEST_REPORTER_ID=8b8822cdaba8bb6c0a9d3f05bea9bc94dbf866ccdd1204913f5673b61caa61b1
13
- language: ruby
14
- dist: focal # TODO Remove this when solved: https://github.com/rvm/rvm/issues/5133
15
- # Buid matrix (rvm x gemfile = 2x2) with one version from each supported major version in range defined in .gemspec for
16
- rvm:
17
- - 2.7.0
18
- - 3.0.1
19
- gemfile:
20
- - gemfiles/jekyll_3.7.x.gemfile
21
- - gemfiles/jekyll_4.x.x.gemfile
22
- cache: bundler
23
- before_install: gem install bundler -v 2.2.18
24
- #install: bundle install # Default
25
- before_script:
26
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
27
- - chmod +x ./cc-test-reporter
28
- - ./cc-test-reporter before-build
29
- #script: bundle exec rake # Default
30
- after_script:
31
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT