jekyll-geolexica 1.9.2 → 1.9.4
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/_includes/localized-concept.html +2 -1
- data/lib/jekyll/geolexica/filters.rb +4 -0
- data/lib/jekyll/geolexica/hooks.rb +27 -13
- data/lib/jekyll/geolexica/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: 54ef6e2ff64adbeb051156e27b33475ecd06a0c321ab219ea1d144ae574e30bf
|
4
|
+
data.tar.gz: 826be73dd58f922954a2e8c6ab4a1b1d26d92bcdf58ae6f7006d1c79cee71b00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0101aa6b4f1514454f25241744e6a9cc4c0b6bec0693ba033b5e9e8d06a7d0c52c2f2ca97f3b9144cc60dd9fe516426f4704ef5682a18d219cb56160993c5f62
|
7
|
+
data.tar.gz: 615062f04d0e212131eabfe49a5fba990536ee81acd109b72a394d6445c502b5d94933da6a1b21104cebb3a207c973152522e165d6f9ddc26d8961a22e76b06c
|
@@ -3,6 +3,7 @@
|
|
3
3
|
{%- assign term_status = english.entry_status -%}
|
4
4
|
{%- assign classification = english.terms.first.normative_status -%}
|
5
5
|
{%- assign english_authoritative_source = english.sources | get_authoritative -%}
|
6
|
+
{%- assign english_authoritative_sources = english.sources | get_all_authoritative_sources -%}
|
6
7
|
{%- assign localized_authoritative_source = localized_term.sources | get_authoritative -%}
|
7
8
|
|
8
9
|
<article
|
@@ -114,7 +115,7 @@
|
|
114
115
|
<p class="origin localized">
|
115
116
|
{% if lang == "eng" %}
|
116
117
|
[SOURCE:
|
117
|
-
{% for source in
|
118
|
+
{% for source in english_authoritative_sources %}
|
118
119
|
{{ source | display_authoritative_source }}{% unless forloop.last %};{% endunless %}
|
119
120
|
{%- endfor -%}
|
120
121
|
]
|
@@ -204,6 +204,10 @@ module Jekyll
|
|
204
204
|
def get_authoritative(sources)
|
205
205
|
sources&.find { |source| source["type"] == "authoritative" }
|
206
206
|
end
|
207
|
+
|
208
|
+
def get_all_authoritative_sources(sources)
|
209
|
+
sources&.select { |source| source["type"] == "authoritative" }
|
210
|
+
end
|
207
211
|
end
|
208
212
|
end
|
209
213
|
end
|
@@ -30,23 +30,37 @@ module Jekyll
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def convert_math(page)
|
33
|
-
|
34
|
-
|
33
|
+
prefix_hash = {
|
34
|
+
asciimath: "stem",
|
35
|
+
latex: "latexmath",
|
36
|
+
}
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
prefix_hash.each do |math_notation, prefix|
|
39
|
+
page.output.gsub!(/#{prefix}:(?<re>\[((?>[^\[\]]+)|\g<re>)*\])/) do
|
40
|
+
ascii_equation = CGI.unescapeHTML(Regexp.last_match[1])[1..-2]
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
42
|
+
mathml_equation = ::Plurimath::Math
|
43
|
+
.parse(ascii_equation, math_notation)
|
44
|
+
.to_mathml
|
43
45
|
|
44
|
-
|
45
|
-
|
46
|
-
mathml_equation.gsub!("\n", "").gsub!("\"", "\\\"") unless page.html?
|
47
|
-
|
48
|
-
mathml_equation
|
46
|
+
normalize_mathml(mathml_equation, page.html?)
|
47
|
+
end
|
49
48
|
end
|
49
|
+
rescue => e
|
50
|
+
# Skipping broken formulas
|
51
|
+
Jekyll.logger.info(e.message)
|
52
|
+
end
|
53
|
+
|
54
|
+
def normalize_mathml(mathml_equation, is_html)
|
55
|
+
# temporary hack to use display inline for math equations because
|
56
|
+
# currently there is no option to use display inline in plurimath
|
57
|
+
mathml_equation = mathml_equation.gsub("display=\"block\"", "display=\"inline\"")
|
58
|
+
|
59
|
+
# Removing newlines(\n) and escaping double quotes(")
|
60
|
+
# because they will cause parsing issues in json
|
61
|
+
mathml_equation = mathml_equation.gsub("\n", "").gsub("\"", "\\\"") unless is_html
|
62
|
+
|
63
|
+
mathml_equation
|
50
64
|
end
|
51
65
|
|
52
66
|
def hook event, target, action
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-geolexica
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glossarist
|