jekyll-glossary_tooltip 1.3.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +2 -0
- data/.github/workflows/cd.yml +30 -0
- data/.github/workflows/codeql-analysis.yml +37 -0
- data/.gitignore +4 -1
- data/.rubocop.yml +53 -7
- data/.ruby-version +1 -1
- data/.simplecov +3 -2
- data/.travis.yml +1 -0
- data/CHANGELOG.md +32 -3
- data/Gemfile +3 -2
- data/OSSMETADATA +1 -0
- data/README.md +60 -38
- data/jekyll-glossary_tooltip.gemspec +3 -3
- data/lib/jekyll-glossary_tooltip/options_parser.rb +4 -1
- data/lib/jekyll-glossary_tooltip/tag.rb +6 -4
- data/lib/jekyll-glossary_tooltip/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02fc27dec8d3491d154f94d40a371caec17b2da3b189d157f708a7ce522a7076
|
4
|
+
data.tar.gz: 49e9d0b6e4f6312c7712df864f51345382e8562a3e124b471415824718ae13d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c423fc44f600f08a8acbe45e94a86d91300efbe69941177529275f9ec8c1d55bb46d728aeba0a4c2b8c43af24e53d1393baf06e431530f05fc6024a0404daa
|
7
|
+
data.tar.gz: 3d07bf135cee11a831071eee2c535eef932563eb7277a14e65db02a435d8e5ae85cd5b764d5afd0e4464e79d2367a829a9807b5755618d7c2048ccda4747e3ff
|
data/.github/dependabot.yml
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Continuous Deployment # Well, semi-continuous
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags: v[0-9]+.[0-9]+.[0-9]+
|
6
|
+
env:
|
7
|
+
RUBY_VER: 3.0.1
|
8
|
+
jobs:
|
9
|
+
test:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ env.RUBY_VER }}
|
17
|
+
bundler-cache: true
|
18
|
+
- name: Run CI Build with Rake
|
19
|
+
run: bundle exec rake
|
20
|
+
release-github:
|
21
|
+
needs: [test]
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v2
|
25
|
+
- name: Build and publish gem to GitHub Packages
|
26
|
+
if: contains(github.ref, 'refs/tags/v')
|
27
|
+
uses: jstastny/publish-gem-to-github@master
|
28
|
+
with:
|
29
|
+
token: ${{ github.token }}
|
30
|
+
owner: ${{ github.repository_owner }}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
name: "CodeQL"
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
# The branches below must be a subset of the branches above
|
8
|
+
branches: [ main ]
|
9
|
+
schedule:
|
10
|
+
- cron: '41 19 1 * *'
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
analyze:
|
14
|
+
name: Analyze
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
permissions:
|
17
|
+
actions: read
|
18
|
+
contents: read
|
19
|
+
security-events: write
|
20
|
+
|
21
|
+
strategy:
|
22
|
+
fail-fast: false
|
23
|
+
matrix:
|
24
|
+
language: [ 'ruby' ]
|
25
|
+
|
26
|
+
steps:
|
27
|
+
- name: Checkout repository
|
28
|
+
uses: actions/checkout@v2
|
29
|
+
|
30
|
+
# Initializes the CodeQL tools for scanning.
|
31
|
+
- name: Initialize CodeQL
|
32
|
+
uses: github/codeql-action/init@v1
|
33
|
+
with:
|
34
|
+
languages: ${{ matrix.language }}
|
35
|
+
|
36
|
+
- name: Perform CodeQL Analysis
|
37
|
+
uses: github/codeql-action/analyze@v1
|
data/.gitignore
CHANGED
@@ -8,7 +8,7 @@ gemfiles/Gemfile*.lock
|
|
8
8
|
# Bundle local config
|
9
9
|
.bundle/
|
10
10
|
|
11
|
-
# Package gem from (
|
11
|
+
# Package gem from $(rake install)
|
12
12
|
pkg/
|
13
13
|
|
14
14
|
# simplecov
|
@@ -19,3 +19,6 @@ coverage/
|
|
19
19
|
.rspec_status
|
20
20
|
spec/dest/
|
21
21
|
spec/reports/
|
22
|
+
|
23
|
+
# Jekyll - when switching from gh-pages-source branch
|
24
|
+
_site/
|
data/.rubocop.yml
CHANGED
@@ -5,6 +5,10 @@ require:
|
|
5
5
|
- rubocop-rake
|
6
6
|
- rubocop-rspec
|
7
7
|
|
8
|
+
inherit_mode:
|
9
|
+
merge:
|
10
|
+
- Exclude # Merge my AllCops.Excllude with default exludes from https://github.com/rubocop/rubocop/blob/master/config/default.yml
|
11
|
+
|
8
12
|
AllCops:
|
9
13
|
TargetRubyVersion: 3.0
|
10
14
|
Include:
|
@@ -14,12 +18,21 @@ AllCops:
|
|
14
18
|
# Travis: during build there will be a lot of rubocop config files in this pat which will cause build failure as the refer to gems which are not installed by this project.
|
15
19
|
# See https://github.com/rubocop/rubocop/issues/9832
|
16
20
|
- gemfiles/vendor/bundle/**/*
|
21
|
+
NewCops: enable
|
17
22
|
|
18
|
-
Gemspec/
|
23
|
+
Gemspec/DeprecatedAttributeAssignment:
|
24
|
+
Enabled: true
|
25
|
+
Gemspec/RequireMFA:
|
19
26
|
Enabled: true
|
20
27
|
|
21
28
|
Layout/LineEndStringConcatenationIndentation:
|
22
29
|
Enabled: true
|
30
|
+
Layout/EmptyLineBetweenDefs:
|
31
|
+
Enabled: true
|
32
|
+
Exclude:
|
33
|
+
- lib/jekyll-glossary_tooltip/errors.rb
|
34
|
+
Layout/SpaceBeforeBrackets:
|
35
|
+
Enabled: true
|
23
36
|
|
24
37
|
Lint/AmbiguousAssignment:
|
25
38
|
Enabled: true
|
@@ -33,10 +46,16 @@ Lint/EmptyBlock:
|
|
33
46
|
Enabled: true
|
34
47
|
Lint/EmptyClass:
|
35
48
|
Enabled: true
|
36
|
-
|
49
|
+
Lint/AmbiguousOperatorPrecedence:
|
50
|
+
Enabled: true
|
51
|
+
Lint/AmbiguousRange:
|
52
|
+
Enabled: true
|
53
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
54
|
+
Enabled: true
|
55
|
+
Lint/RequireRelativeSelfPath:
|
56
|
+
Enabled: true
|
57
|
+
Lint/UselessRuby2Keywords:
|
37
58
|
Enabled: true
|
38
|
-
Exclude:
|
39
|
-
- lib/jekyll-glossary_tooltip/errors.rb
|
40
59
|
Lint/EmptyInPattern:
|
41
60
|
Enabled: true
|
42
61
|
Lint/LambdaWithoutLiteralBlock:
|
@@ -51,8 +70,6 @@ Lint/OrAssignmentToConstant:
|
|
51
70
|
Enabled: true
|
52
71
|
Lint/RedundantDirGlobSort:
|
53
72
|
Enabled: true
|
54
|
-
Layout/SpaceBeforeBrackets:
|
55
|
-
Enabled: true
|
56
73
|
Lint/SymbolConversion:
|
57
74
|
Enabled: true
|
58
75
|
Lint/ToEnumArguments:
|
@@ -70,7 +87,6 @@ Lint/UselessAccessModifier:
|
|
70
87
|
|
71
88
|
Metrics/AbcSize:
|
72
89
|
Enabled: true
|
73
|
-
Max: 25
|
74
90
|
Metrics/BlockLength:
|
75
91
|
Enabled: true
|
76
92
|
Max: 100
|
@@ -84,6 +100,11 @@ Naming/FileName:
|
|
84
100
|
- lib/jekyll-glossary_tooltip.rb
|
85
101
|
Naming/InclusiveLanguage:
|
86
102
|
Enabled: true
|
103
|
+
Naming/BlockForwarding:
|
104
|
+
Enabled: true
|
105
|
+
|
106
|
+
Security/IoMethods:
|
107
|
+
Enabled: true
|
87
108
|
|
88
109
|
Style/ArgumentsForwarding:
|
89
110
|
Enabled: true
|
@@ -131,6 +152,22 @@ Style/StringLiteralsInInterpolation:
|
|
131
152
|
EnforcedStyle: double_quotes
|
132
153
|
Style/SwapValues:
|
133
154
|
Enabled: true
|
155
|
+
Style/FileRead:
|
156
|
+
Enabled: true
|
157
|
+
Style/FileWrite:
|
158
|
+
Enabled: true
|
159
|
+
Style/MapToHash:
|
160
|
+
Enabled: true
|
161
|
+
Style/NumberedParameters:
|
162
|
+
Enabled: true
|
163
|
+
Style/NumberedParametersLimit:
|
164
|
+
Enabled: true
|
165
|
+
Style/OpenStructUse:
|
166
|
+
Enabled: true
|
167
|
+
Style/RedundantSelfAssignmentBranch:
|
168
|
+
Enabled: true
|
169
|
+
Style/SelectByRegexp:
|
170
|
+
Enabled: true
|
134
171
|
|
135
172
|
|
136
173
|
# Reference: https://github.com/rubocop/rubocop-rake/blob/master/config/default.yml
|
@@ -151,3 +188,12 @@ RSpec/Rails/AvoidSetupHook:
|
|
151
188
|
Enabled: false
|
152
189
|
RSpec/BeforeAfterAll:
|
153
190
|
Enabled: false
|
191
|
+
RSpec/ExcessiveDocstringSpacing:
|
192
|
+
Enabled: true
|
193
|
+
RSpec/SubjectDeclaration:
|
194
|
+
Enabled: true
|
195
|
+
RSpec/FactoryBot/SyntaxMethods:
|
196
|
+
Enabled: true
|
197
|
+
RSpec/MultipleMemoizedHelpers:
|
198
|
+
Enabled: true
|
199
|
+
Max: 10
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0
|
1
|
+
3.1.0
|
data/.simplecov
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# vi: ft=ruby
|
2
2
|
|
3
3
|
SimpleCov.start do
|
4
|
-
enable_coverage
|
5
|
-
minimum_coverage 90
|
4
|
+
enable_coverage :branch # Add branch coverage statistics.
|
5
|
+
minimum_coverage 90 # Minimum coverage percentage.
|
6
|
+
command_name "test:bdd" # Must be set for codeclimat reporter
|
6
7
|
end
|
data/.travis.yml
CHANGED
@@ -11,6 +11,7 @@ env:
|
|
11
11
|
global:
|
12
12
|
- CC_TEST_REPORTER_ID=8b8822cdaba8bb6c0a9d3f05bea9bc94dbf866ccdd1204913f5673b61caa61b1
|
13
13
|
language: ruby
|
14
|
+
dist: focal # TODO Remove this when solved: https://github.com/rvm/rvm/issues/5133
|
14
15
|
# Buid matrix (rvm x gemfile = 2x2) with one version from each supported major version in range defined in .gemspec for
|
15
16
|
rvm:
|
16
17
|
- 2.7.0
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,42 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [1.5.0] - 2022-09-08
|
10
|
+
### Added
|
11
|
+
- Support for embedded liqid tags in the url field. ([#3](https://github.com/erikw/jekyll-glossary_tooltip/issues/3])
|
12
|
+
|
13
|
+
## [1.4.0] - 2021-08-18
|
14
|
+
### Changed
|
15
|
+
* Bump local ruby to 3.1.0
|
16
|
+
|
17
|
+
## [1.3.1] - 2021-08-18
|
18
|
+
### Added
|
19
|
+
- GitHub workflow to publish to GitHub Packages.
|
20
|
+
|
21
|
+
## [1.3.1] - 2021-08-18
|
22
|
+
### Fixed
|
23
|
+
- gemspec dependency range stynax.
|
24
|
+
|
1
25
|
## [1.3.0] - 2021-08-07
|
26
|
+
### Changed
|
2
27
|
- Open the souce link from a tooltip in a new tab.
|
3
28
|
|
4
29
|
## [1.2.0] - 2021-08-06
|
5
|
-
|
30
|
+
### Added
|
31
|
+
- Bottom arrow to the tooltip.
|
32
|
+
- Tooltip hover animation from invisible to visible.
|
33
|
+
|
34
|
+
### Changed
|
6
35
|
- Restyle the glossary term bottom border style and color.
|
7
|
-
- Add tooltip hover animation from invisible to visible.
|
8
36
|
|
9
37
|
## [1.1.0] - 2021-08-06
|
10
|
-
|
38
|
+
### Added
|
39
|
+
- Optional `display:` argument to set a different term display name, rather than using the term name as defined in the glossary file. Usage: `{% glossary term_name, display: Different Name To Display %}`.
|
11
40
|
|
12
41
|
## [1.0.0] - 2021-08-05
|
13
42
|
- No changes from `v0.1.0` but just bumping to final first major release version!
|
data/Gemfile
CHANGED
@@ -12,10 +12,11 @@ gemspec
|
|
12
12
|
# Reference: https://github.com/rubygems/bundler/pull/7222
|
13
13
|
# However there's an argument for using gemspec too: https://bundler.io/guides/creating_gem.html#testing-our-gem
|
14
14
|
group :development, :test do
|
15
|
-
gem "rake", "~> 13.0", require: false
|
16
|
-
gem "travis", "~> 1.0", require: false
|
17
15
|
gem "appraisal", "~> 2.4", require: false
|
18
16
|
gem "gem-release", "~> 2.0", require: false
|
17
|
+
gem "rake", "~> 13.0", require: false
|
18
|
+
gem "solargraph", require: false
|
19
|
+
gem "travis", "~> 1.0", require: false
|
19
20
|
end
|
20
21
|
|
21
22
|
group :test do
|
data/OSSMETADATA
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
osslifecycle=active
|
data/README.md
CHANGED
@@ -1,25 +1,38 @@
|
|
1
|
-
# Jekyll Glossary Tooltip Tag Plugin
|
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)
|
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://ruby-gem-downloads-badge.herokuapp.com/jekyll-glossary_tooltip?color=brightgreen&type=total&label=gem%20downloads)](https://rubygems.org/gems/jekyll-glossary_tooltip)
|
4
|
-
[![Travis Build Status](https://img.shields.io/travis/erikw/jekyll-glossary_tooltip/main?logo=travis)](https://travis-ci.com/erikw/jekyll-glossary_tooltip)
|
4
|
+
[![Travis Build Status](https://img.shields.io/travis/erikw/jekyll-glossary_tooltip/main?logo=travis)](https://app.travis-ci.com/github/erikw/jekyll-glossary_tooltip)
|
5
5
|
[![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/7ffb648ec4b77f3f9eb8/maintainability)](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/maintainability)
|
6
6
|
[![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/7ffb648ec4b77f3f9eb8/test_coverage)](https://codeclimate.com/github/erikw/jekyll-glossary_tooltip/test_coverage)
|
7
|
+
[![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)
|
8
|
+
[![SLOC](https://img.shields.io/tokei/lines/github/erikw/jekyll-glossary_tooltip?logo=codefactor&logoColor=lightgrey)](#)
|
9
|
+
[![License](https://img.shields.io/github/license/erikw/jekyll-glossary_tooltip)](LICENSE.txt)
|
10
|
+
[![OSS Lifecycle](https://img.shields.io/osslifecycle/erikw/jekyll-glossary_tooltip)](https://github.com/Netflix/osstracker)
|
11
|
+
|
12
|
+
|
13
|
+
:point_right: **Live demo**: https://erikw.github.io/jekyll-glossary_tooltip/
|
7
14
|
|
8
15
|
<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'.">
|
9
16
|
|
10
17
|
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.
|
11
18
|
|
12
|
-
It's also possible to provide an optional URL to
|
19
|
+
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.
|
13
20
|
|
14
21
|
|
15
22
|
# Installation
|
16
|
-
1. Add this gem to your Jekyll site's Gemfile
|
17
|
-
|
18
|
-
|
23
|
+
1. Add this gem to your Jekyll site's Gemfile in the `:jekyll_plugins` group:
|
24
|
+
* On CLI (in project root directory):
|
25
|
+
```shell
|
26
|
+
bundle add --group jekyll_plugins jekyll-glossary_tooltip
|
27
|
+
```
|
28
|
+
* Or manually:
|
19
29
|
```ruby
|
30
|
+
group :jekyll_plugins do
|
31
|
+
[...]
|
20
32
|
gem 'jekyll-glossary_tooltip'
|
33
|
+
end
|
21
34
|
```
|
22
|
-
|
35
|
+
1. Run `$ bundle install`.
|
23
36
|
1. In your site's `_config.yml`, enable the plugin:
|
24
37
|
```yml
|
25
38
|
plugins:
|
@@ -29,13 +42,13 @@ It's also possible to provide an optional URL to further term definition or sour
|
|
29
42
|
1. Use the liquid tag in a page like `{% glossary term_name %}`
|
30
43
|
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.
|
31
44
|
1. Now just build your site and you will get nice nice term definition tooltips on mouse hover (or mobile, tap) for you terms!
|
32
|
-
```
|
33
|
-
|
45
|
+
```shell
|
46
|
+
bundle exec jekyll build
|
34
47
|
```
|
35
48
|
|
36
49
|
# Usage
|
37
50
|
## Glossary Term Definition File
|
38
|
-
Create a file `_data/glossary.yml` to host your shared term definition entries. This file should contain a list of term entries
|
51
|
+
Create a file `_data/glossary.yml` to host your shared term definition entries. This file should contain a list of term entries in the format of:
|
39
52
|
|
40
53
|
```markdown
|
41
54
|
- term: a_term_name # Can contain spaces
|
@@ -55,8 +68,14 @@ This could look something like:
|
|
55
68
|
- term: Jamstack
|
56
69
|
definition: JavaScript + API + Markup - a way of buildin and hosting websites.
|
57
70
|
url: https://jamstack.org/
|
71
|
+
- term: EmbeddedLiquidURL
|
72
|
+
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.)
|
73
|
+
url: >
|
74
|
+
{{ site.baseurl }}{% link page2.md %}
|
58
75
|
```
|
59
76
|
|
77
|
+
1. See [here](https://documentation.platformos.com/use-cases/using-liquid-markup-yaml) for notes on using Liquid in YAML.
|
78
|
+
|
60
79
|
|
61
80
|
## Tag Usage
|
62
81
|
On any page where you've made sure include the needed CSS styling, you can use the glossary tag simply like
|
@@ -92,7 +111,7 @@ After checking out the repo;
|
|
92
111
|
1. run `script/test` to run the tests
|
93
112
|
1. You can also run `script/console` for an interactive prompt that will allow you to experiment.
|
94
113
|
|
95
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
114
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
96
115
|
|
97
116
|
|
98
117
|
## Local development
|
@@ -115,22 +134,22 @@ Instructions for releasing on rubygems.org below. Optionally make a GitHub [rele
|
|
115
134
|
|
116
135
|
## Using bundler/gem_tasks rake tasks
|
117
136
|
Following instructions from [bundler.io](https://bundler.io/guides/creating_gem.html#releasing-the-gem):
|
118
|
-
```
|
119
|
-
|
120
|
-
|
121
|
-
|
137
|
+
```shell
|
138
|
+
vi -p lib/jekyll-glossary_tooltip/version.rb CHANGELOG.md
|
139
|
+
bundle exec rake build
|
140
|
+
ver=$(ruby -r ./lib/jekyll-glossary_tooltip/version.rb -e 'puts Jekyll::GlossaryTooltip::VERSION')
|
122
141
|
|
123
142
|
# Optional: test locally by including in another project
|
124
|
-
|
143
|
+
gem install pkg/jekyll-glossary_tooltip-$ver.gem
|
125
144
|
|
126
|
-
|
145
|
+
bundle exec rake release
|
127
146
|
```
|
128
147
|
|
129
148
|
## Using gem-release gem extension
|
130
149
|
Using [gem-release](https://github.com/svenfuchs/gem-release):
|
131
|
-
```
|
132
|
-
|
133
|
-
|
150
|
+
```shell
|
151
|
+
vi CHANGELOG.md && git add CHANGELOG.md && git commit -m "Update CHANGELOG.md" && git push
|
152
|
+
gem bump --version minor --tag --push --release --sign
|
134
153
|
```
|
135
154
|
For `--version`, use `major|minor|patch` as needed.
|
136
155
|
|
@@ -138,18 +157,18 @@ For `--version`, use `major|minor|patch` as needed.
|
|
138
157
|
* For ruby, just use RVM to switch between supported ruby version specified in `.gemspec`.
|
139
158
|
* To run with different jekyll versions, [Appraisal](https://github.com/thoughtbot/appraisal) is used with [`Appraisals`](Appraisals) to generate different [`gemfiles/`](gemfiles/)
|
140
159
|
- To use a specific Gemfile, run like
|
141
|
-
```
|
142
|
-
|
143
|
-
|
160
|
+
```shell
|
161
|
+
BUNDLE_GEMFILE=gemfiles/jekyll_4.x.x.gemfile bundle exec rake spec
|
162
|
+
bundle exec appraisal jekyll-4.x.x rake spec
|
144
163
|
```
|
145
164
|
- To run `rake spec` for all gemfiles:
|
146
|
-
```
|
147
|
-
|
165
|
+
```shell
|
166
|
+
bundle exec appraisal rake spec
|
148
167
|
```
|
149
168
|
- To generate new/updated gemfiles from `Appraisals`
|
150
|
-
```
|
151
|
-
|
152
|
-
|
169
|
+
```shell
|
170
|
+
bundle exec appraisal install
|
171
|
+
bundle exec appraisal generate --travis
|
153
172
|
```
|
154
173
|
|
155
174
|
## Travis
|
@@ -159,22 +178,25 @@ To use the [travis cli client](https://github.com/travis-ci/travis.rb) (installe
|
|
159
178
|
- create a new token named `travis-cli`
|
160
179
|
- Set the scopes `repo`, `read:org`, `user:email` according to the [docs](https://docs.travis-ci.com/user/github-oauth-scopes).
|
161
180
|
1. Set travis.com as the default so we don't need to add `--pro` to most commands
|
162
|
-
```
|
163
|
-
|
181
|
+
```shell
|
182
|
+
bundle exec travis endpoint --set-default --api-endpoint https://api.travis-ci.com/
|
164
183
|
```
|
165
184
|
1. Login with the cli client
|
166
|
-
```
|
167
|
-
|
185
|
+
```shell
|
186
|
+
bundle exec travis login --github-token $GITHUB_TOKEN
|
168
187
|
```
|
169
188
|
1. Now the cli client can be used (might need `--pro` to use travis.com)
|
170
|
-
```
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
189
|
+
```shell
|
190
|
+
bundle exec travis lint
|
191
|
+
bundle exec travis accounts
|
192
|
+
bundle exec travis status
|
193
|
+
bundle exec travis branches
|
194
|
+
bundle exec travis monitor
|
176
195
|
```
|
177
196
|
|
197
|
+
## Live Demo GitHub Pages
|
198
|
+
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`!
|
199
|
+
|
178
200
|
# Contributing
|
179
201
|
Bug reports and pull requests are welcome on GitHub at https://github.com/erikw/jekyll-glossary_tooltip.
|
180
202
|
|
@@ -8,11 +8,11 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Erik Westrup"]
|
9
9
|
spec.email = ["erik.westrup@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = "Jekyll plugin providing a glossary liquid tag that will show a tooltip of a term definition in your site"
|
11
|
+
spec.summary = "Jekyll plugin providing a glossary liquid tag that will show a tooltip of a term definition in your site."
|
12
12
|
spec.description = "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."
|
13
13
|
spec.homepage = "https://github.com/erikw/jekyll-glossary_tooltip/"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 2.7", "< 4"
|
15
|
+
spec.required_ruby_version = [">= 2.7", "< 4"]
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/erikw/jekyll-glossary_tooltip/"
|
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_dependency "jekyll", ">= 3.7", "< 5.0"
|
30
|
+
spec.add_dependency "jekyll", [">= 3.7", "< 5.0"]
|
31
31
|
end
|
@@ -23,7 +23,11 @@ module Jekyll
|
|
23
23
|
|
24
24
|
options[:term_query] = opt_segments[0]
|
25
25
|
opt_segments.shift
|
26
|
+
parse_segments(options, opt_segments)
|
27
|
+
options
|
28
|
+
end
|
26
29
|
|
30
|
+
def parse_segments(options, opt_segments)
|
27
31
|
opt_segments.each do |opt_segment|
|
28
32
|
raise Errors::OptionsBadTagArgumentFormat, options[:term_name] unless opt_segment =~ ARGS_PATTERN
|
29
33
|
|
@@ -33,7 +37,6 @@ module Jekyll
|
|
33
37
|
|
34
38
|
options[arg_name.to_sym] = arg_value
|
35
39
|
end
|
36
|
-
options
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
@@ -18,7 +18,7 @@ module Jekyll
|
|
18
18
|
<<~HTML
|
19
19
|
<span class="jekyll-glossary">
|
20
20
|
#{@opts[:display]}
|
21
|
-
<span class="jekyll-glossary-tooltip">#{entry["definition"]}#{render_tooltip_url(entry)}</span>
|
21
|
+
<span class="jekyll-glossary-tooltip">#{entry["definition"]}#{render_tooltip_url(entry, context)}</span>
|
22
22
|
</span>
|
23
23
|
HTML
|
24
24
|
end
|
@@ -27,11 +27,13 @@ module Jekyll
|
|
27
27
|
|
28
28
|
LOG_TAG = "Glossary Tag:"
|
29
29
|
|
30
|
-
def render_tooltip_url(entry)
|
30
|
+
def render_tooltip_url(entry, context)
|
31
31
|
# The content of the anchor is set from the CSS class jekyll-glossary-source-link,
|
32
32
|
# so that the plugin user can customize the text without touching ruby source.
|
33
|
-
|
34
|
-
|
33
|
+
return "" if entry["url"].nil?
|
34
|
+
|
35
|
+
url = Liquid::Template.parse(entry["url"]).render(context).strip
|
36
|
+
"<br><a class=\"jekyll-glossary-source-link\" href=\"#{url}\" target=\"_blank\"></a>"
|
35
37
|
end
|
36
38
|
|
37
39
|
def lookup_entry(site, term_name)
|
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.
|
4
|
+
version: 1.5.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:
|
11
|
+
date: 2022-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -45,6 +45,8 @@ files:
|
|
45
45
|
- ".codeclimate.yml"
|
46
46
|
- ".editorconfig"
|
47
47
|
- ".github/dependabot.yml"
|
48
|
+
- ".github/workflows/cd.yml"
|
49
|
+
- ".github/workflows/codeql-analysis.yml"
|
48
50
|
- ".gitignore"
|
49
51
|
- ".rspec"
|
50
52
|
- ".rubocop.yml"
|
@@ -56,6 +58,7 @@ files:
|
|
56
58
|
- CONTRIBUTING.md
|
57
59
|
- Gemfile
|
58
60
|
- LICENSE.txt
|
61
|
+
- OSSMETADATA
|
59
62
|
- README.md
|
60
63
|
- Rakefile
|
61
64
|
- SECURITY.md
|
@@ -101,9 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
104
|
- !ruby/object:Gem::Version
|
102
105
|
version: '0'
|
103
106
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
107
|
+
rubygems_version: 3.3.3
|
105
108
|
signing_key:
|
106
109
|
specification_version: 4
|
107
110
|
summary: Jekyll plugin providing a glossary liquid tag that will show a tooltip of
|
108
|
-
a term definition in your site
|
111
|
+
a term definition in your site.
|
109
112
|
test_files: []
|