metanorma-plugin-glossarist 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquid/drops/concepts_drop.rb +12 -0
- data/lib/metanorma/plugin/glossarist/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: 8b6290545d75d21cefa6a6960b79105dd75412eff970547a3a234816594b03ed
|
4
|
+
data.tar.gz: '0647850cbe587276287c59670b1fc99d33e24e3eea4540c23506d49747672380'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa96058a858415981ab0d59fb359e9ca52dcbdf105748514481c28e50f569568c4c59c5a894c7685a27b4ebd4d2d4e38863bcd88541ca16b8b2162dfc9d26eb7
|
7
|
+
data.tar.gz: e7d6f5e73dd576499dfeea2f91243b48164e35249fef1f5b70bfdafe57609c5a8695f120d2a8b3e5b2c802c9b6975bff9a0e1a3bfa5a948ad8f9c18079b30868
|
@@ -34,6 +34,7 @@ module Liquid
|
|
34
34
|
concept_filters = filters.dup
|
35
35
|
language_filter = concept_filters.delete('lang')
|
36
36
|
sort_filter = concept_filters.delete('sort_by')
|
37
|
+
group_filter = concept_filters.delete('group')
|
37
38
|
|
38
39
|
concepts = concepts_collection.to_h["managed_concepts"].map do |concept|
|
39
40
|
filtered_concept = concept.dup
|
@@ -61,6 +62,7 @@ module Liquid
|
|
61
62
|
end
|
62
63
|
end.compact
|
63
64
|
|
65
|
+
apply_group_filter(concepts, group_filter)
|
64
66
|
apply_sort_filter(concepts, sort_filter)
|
65
67
|
end
|
66
68
|
|
@@ -70,6 +72,16 @@ module Liquid
|
|
70
72
|
concepts.sort_by { |concept| concept.dig(*extract_nested_field_names(sort_by)) }
|
71
73
|
end
|
72
74
|
|
75
|
+
def apply_group_filter(concepts, groups)
|
76
|
+
return concepts unless groups
|
77
|
+
|
78
|
+
concepts.select! do |concept|
|
79
|
+
groups.split(",").reduce(true) do |pre_result, group|
|
80
|
+
pre_result && concept["groups"].include?(group.strip)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
73
85
|
def extract_nested_field_names(name)
|
74
86
|
name.split(".").map do |field|
|
75
87
|
field_name = field.strip
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-plugin-glossarist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|