elixir-toolkit-theme-plugins 1.2.0 → 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/README.md +51 -0
- data/lib/elixir-toolkit-theme-plugins/tool_tag.rb +10 -9
- data/lib/elixir-toolkit-theme-plugins/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: 8c89eb377a675bfe33fabd2c0a4b85f5a2a69224f2969d2b77bd8769ed0d3926
|
|
4
|
+
data.tar.gz: d1a6d47ad43ec14f31826c45794a8f66da4d291a5e6dc8ae1311ed91fc47952c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8cf38f17e18d4db1240fa2a7a5a771bfffa5d9338688db9be1980ce6001b26ecbd399c879eee1e344b5ef3eb08dd6dc95cc054dc921539166696cf763dcebf86
|
|
7
|
+
data.tar.gz: e921fb66f5c9462050779973e9fe4277cc2a646a2b22cff6062db00c8f9acfb8efb3de0c57fef4987f2400bc5b440523eb49d400ffa2ef432607fd42a3c923e0
|
data/README.md
CHANGED
|
@@ -7,3 +7,54 @@ This features include:
|
|
|
7
7
|
* An improved way of tagging tools from a central tools table in the content of a page.
|
|
8
8
|
* Making sure the correct Git branch is detected when the theme is being deployed.
|
|
9
9
|
|
|
10
|
+
## Local development
|
|
11
|
+
|
|
12
|
+
### Requirements
|
|
13
|
+
|
|
14
|
+
* **Ruby** (the release workflow uses Ruby 3.3)
|
|
15
|
+
* **Bundler**
|
|
16
|
+
|
|
17
|
+
### Building the gem locally
|
|
18
|
+
|
|
19
|
+
The gem version is read from [`lib/elixir-toolkit-theme-plugins/version.rb`](lib/elixir-toolkit-theme-plugins/version.rb), so bump `VERSION` there first if needed. Then build from the root of this repository:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
gem build elixir-toolkit-theme-plugins.gemspec
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This produces `elixir-toolkit-theme-plugins-<VERSION>.gem`. Built gems are ignored by `.gitignore`, so they will not show up in `git status`.
|
|
26
|
+
|
|
27
|
+
To install your local build into your Ruby installation:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
gem install ./elixir-toolkit-theme-plugins-<VERSION>.gem
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Testing with an ETT deployment
|
|
34
|
+
|
|
35
|
+
You need a Jekyll site that uses the theme to see the plugins in action. Either works:
|
|
36
|
+
|
|
37
|
+
* the [theme repository](https://github.com/ELIXIR-Belgium/elixir-toolkit-theme) itself, which is a full Jekyll site
|
|
38
|
+
* the [example site](https://github.com/ELIXIR-Belgium/elixir-toolkit-theme-example)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
Pin that exact version in the site's `Gemfile`:
|
|
42
|
+
|
|
43
|
+
```ruby
|
|
44
|
+
gem "elixir-toolkit-theme-plugins", "<VERSION>"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Followed by `bundle install`. This is the closest match to what users get from RubyGems.
|
|
48
|
+
|
|
49
|
+
#### What to check
|
|
50
|
+
|
|
51
|
+
The plugins only do something on pages that use them, so make sure your test site exercises them:
|
|
52
|
+
|
|
53
|
+
* The `{% tool "tool_id" %}` tag and the resource tables read `_data/tool_and_resource_list.yml` from the **site root**. Run `jekyll` from that root, otherwise the tools file is not found.
|
|
54
|
+
* In the theme repository, `pages/documentation/resource_table.md` already contains `{% tool %}` examples. Load that page and click a tool to open its popover.
|
|
55
|
+
|
|
56
|
+
## Releasing
|
|
57
|
+
|
|
58
|
+
Releases are automated by [`.github/workflows/release.yml`](.github/workflows/release.yml).
|
|
59
|
+
|
|
60
|
+
Consumers pin this gem to an exact version, so a new release also needs the version bumped in the theme's `Gemfile` and `elixir-toolkit-theme.gemspec`.
|
|
@@ -108,7 +108,7 @@ module Jekyll
|
|
|
108
108
|
data-bs-content="<h5>#{html_escape(tool["name"])}</h5><div class='mb-2'>#{html_escape(tool["description"])}</div><div class='d-flex flex-wrap gap-1'>#{tags}</div>"
|
|
109
109
|
data-bs-template="<div class='popover popover-tool' role='tooltip'><div class='popover-arrow'></div><h3 class='popover-header'></h3><div class='popover-body'></div></div>"
|
|
110
110
|
data-bs-html="true"
|
|
111
|
-
><i class="
|
|
111
|
+
><i class="icon-wrench me-2"></i>#{ html_escape(tool["name"]) }</a>}
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
def find_tool(tool_id)
|
|
@@ -119,13 +119,13 @@ module Jekyll
|
|
|
119
119
|
|
|
120
120
|
def create_tags(tool, site)
|
|
121
121
|
tags = ""
|
|
122
|
-
tags << create_tag("#{tool["url"]}", "
|
|
122
|
+
tags << create_tag("#{tool["url"]}", "icon-link", "Website")
|
|
123
123
|
if tool["registry"]
|
|
124
124
|
registry = tool["registry"]
|
|
125
|
-
tags << create_tag("https://bio.tools/#{registry["biotools"]}", "
|
|
126
|
-
tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "
|
|
127
|
-
tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "
|
|
128
|
-
tags << create_tag("https://europepmc.org/article/MED/#{registry["europmc"]}", "
|
|
125
|
+
tags << create_tag("https://bio.tools/#{registry["biotools"]}", "icon-info", "Tool info") if registry["biotools"] && registry["biotools"] != "NA"
|
|
126
|
+
tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "icon-database", "Standards/Databases") if registry["fairsharing"] && registry["fairsharing"] != "NA"
|
|
127
|
+
tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "icon-graduation-cap", "Training") if registry["tess"] && registry["tess"] != "NA"
|
|
128
|
+
tags << create_tag("https://europepmc.org/article/MED/#{registry["europmc"]}", "icon-book-open", "Publication") if registry["europmc"] && registry["europmc"] != "NA"
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
instances = @instances_by_tool[tool["id"]]
|
|
@@ -134,7 +134,7 @@ module Jekyll
|
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
def create_tag(url, icon, label)
|
|
137
|
-
"<a href='#{html_attr(url)}' target='_blank' rel='noopener'><span class='badge bg-dark text-white hover-primary'><i class='
|
|
137
|
+
"<a href='#{html_attr(url)}' target='_blank' rel='noopener'><span class='badge bg-dark text-white hover-primary'><i class='#{icon} me-2'></i>#{html_escape(label)}</span></a>"
|
|
138
138
|
end
|
|
139
139
|
|
|
140
140
|
def instances_dropdown(instances, site, tool_id)
|
|
@@ -142,7 +142,8 @@ module Jekyll
|
|
|
142
142
|
|
|
143
143
|
items = instances.map do |inst|
|
|
144
144
|
href = inst["url"] || resolve_page_url(inst["page_path"], site) || "#"
|
|
145
|
-
|
|
145
|
+
country_code = inst["country_code"].to_s.strip.downcase
|
|
146
|
+
flag = country_code.empty? ? "" : "<span class='fi fi-#{html_attr(country_code)} ms-2 shadow-sm'></span>"
|
|
146
147
|
name = html_escape(inst["name"])
|
|
147
148
|
url = html_attr(href)
|
|
148
149
|
"<li><a class='dropdown-item' href='#{url}' target='_blank' rel='noopener'>#{name} #{flag}</a></li>"
|
|
@@ -155,7 +156,7 @@ module Jekyll
|
|
|
155
156
|
id='#{dd_id}'
|
|
156
157
|
data-bs-toggle='dropdown'
|
|
157
158
|
aria-expanded='false'>
|
|
158
|
-
<i class='
|
|
159
|
+
<i class='icon-globe me-2'></i>Instances
|
|
159
160
|
</button>
|
|
160
161
|
<ul class='dropdown-menu' aria-labelledby='#{dd_id}'>
|
|
161
162
|
#{items}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elixir-toolkit-theme-plugins
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- bedroesb
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2026-
|
|
13
|
+
date: 2026-09-15 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: jekyll
|