jekyll-geolexica 1.9.0 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/concept-api-links.html +5 -5
- data/_includes/head.html +8 -8
- data/_includes/script.html +17 -2
- data/_layouts/custom-home.html +1 -1
- data/_layouts/default.html +2 -2
- data/_pages/concept-search-index.jbuilder +2 -2
- data/_pages/concepts-index.jbuilder +5 -2
- data/assets/js/concept-search-worker.js +2 -2
- data/assets/js/concept-search.js +2 -2
- data/jekyll-geolexica.gemspec +3 -1
- data/lib/jekyll/geolexica/glossary.rb +1 -0
- data/lib/jekyll/geolexica/hooks.rb +21 -0
- data/lib/jekyll/geolexica/version.rb +1 -1
- data/lib/jekyll/geolexica.rb +1 -0
- metadata +32 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9bd91cb309055026c71c87645e7196ff3d4b3116de988a8499ef49805b6f72b
|
4
|
+
data.tar.gz: 6c2a5bebd531945f9d75f9e7c64e515b6292fd488b81a157421aa4852e62cb15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e90fb75be8eb7f4b77ea2cd5801da1e3678c43837686130ddecce1917a7a8b23596574d973f5d8795a899562e3eab91407c520fda05492d39288fd3d60d2c480
|
7
|
+
data.tar.gz: 55b7408414a081804d8c2f6b988f79a21f7ced484a8acc4fb57d29cb762b1e043459a25545a10bbb4e2f90b2250a7312fa677ff9baf0e3cd799b4597f522d54d
|
@@ -2,7 +2,7 @@
|
|
2
2
|
{%- if json_url %}
|
3
3
|
<section class="field json">
|
4
4
|
<p class="field-name">JSON</p>
|
5
|
-
<p class="field-value"><a href="{{ json_url }}">{{ json_url }}</a></p>
|
5
|
+
<p class="field-value"><a href="{{ json_url | relative_url }}">{{ json_url | relative_url }}</a></p>
|
6
6
|
</section>
|
7
7
|
{% endif -%}
|
8
8
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
{%- if yaml_url %}
|
11
11
|
<section class="field yaml">
|
12
12
|
<p class="field-name">YAML</p>
|
13
|
-
<p class="field-value"><a href="{{ yaml_url }}">{{ yaml_url }}</a></p>
|
13
|
+
<p class="field-value"><a href="{{ yaml_url | relative_url }}">{{ yaml_url | relative_url }}</a></p>
|
14
14
|
</section>
|
15
15
|
{% endif -%}
|
16
16
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
{%- if json_url %}
|
19
19
|
<section class="field json">
|
20
20
|
<p class="field-name">SKOS in JSON-LD</p>
|
21
|
-
<p class="field-value"><a href="{{ json_url }}">{{ json_url }}</a></p>
|
21
|
+
<p class="field-value"><a href="{{ json_url | relative_url }}">{{ json_url | relative_url }}</a></p>
|
22
22
|
</section>
|
23
23
|
{% endif -%}
|
24
24
|
|
@@ -26,7 +26,7 @@
|
|
26
26
|
{%- if ttl_url %}
|
27
27
|
<section class="field ttl">
|
28
28
|
<p class="field-name">SKOS in RDF</p>
|
29
|
-
<p class="field-value"><a href="{{ ttl_url }}">{{ ttl_url }}</a></p>
|
29
|
+
<p class="field-value"><a href="{{ ttl_url | relative_url }}">{{ ttl_url | relative_url }}</a></p>
|
30
30
|
</section>
|
31
31
|
{% endif -%}
|
32
32
|
|
@@ -34,6 +34,6 @@
|
|
34
34
|
{%- if tbx_url %}
|
35
35
|
<section class="field tbx">
|
36
36
|
<p class="field-name">TBX-ISO-TML</p>
|
37
|
-
<p class="field-value"><a href="{{ tbx_url }}">{{ tbx_url }}</a></p>
|
37
|
+
<p class="field-value"><a href="{{ tbx_url | relative_url }}">{{ tbx_url | relative_url }}</a></p>
|
38
38
|
</section>
|
39
39
|
{% endif -%}
|
data/_includes/head.html
CHANGED
@@ -9,15 +9,15 @@
|
|
9
9
|
|
10
10
|
<title>{% include title.html %}</title>
|
11
11
|
|
12
|
-
<link rel="icon" type="image/png" href="/images/favicon-32x32.png" sizes="32x32" />
|
13
|
-
<link rel="icon" type="image/png" href="/images/android-chrome-192x192.png" sizes="192x192" />
|
14
|
-
<link rel="icon" type="image/png" href="/images/favicon-96x96.png" sizes="96x96" />
|
15
|
-
<link rel="icon" type="image/png" href="/images/favicon-16x16.png" sizes="16x16" />
|
16
|
-
<link rel="shortcut icon" href="/favicon.ico" />
|
12
|
+
<link rel="icon" type="image/png" href="{{ '/images/favicon-32x32.png' | relative_url }}" sizes="32x32" />
|
13
|
+
<link rel="icon" type="image/png" href="{{ '/images/android-chrome-192x192.png' | relative_url }}" sizes="192x192" />
|
14
|
+
<link rel="icon" type="image/png" href="{{ '/images/favicon-96x96.png' | relative_url }}" sizes="96x96" />
|
15
|
+
<link rel="icon" type="image/png" href="{{ '/images/favicon-16x16.png' | relative_url }}" sizes="16x16" />
|
16
|
+
<link rel="shortcut icon" href="{{ '/favicon.ico' | relative_url }}" />
|
17
17
|
|
18
18
|
<meta name="msapplication-TileColor" content="#ffffff" />
|
19
|
-
<meta name="msapplication-TileImage" content="/images/mstile-144x144.png" />
|
20
|
-
<meta name="msapplication-config" content="/browserconfig.xml" />
|
19
|
+
<meta name="msapplication-TileImage" content="{{ '/images/mstile-144x144.png' | relative_url }}" />
|
20
|
+
<meta name="msapplication-config" content="{{ '/browserconfig.xml' | relative_url }}" />
|
21
21
|
<meta name="theme-color" content="#ffffff" />
|
22
22
|
|
23
23
|
<link rel="canonical" href="{{ page.url | replace: 'index.html', '' | relative_url }}" />
|
@@ -26,7 +26,7 @@
|
|
26
26
|
{% if extra_stylesheets %}
|
27
27
|
{% for ss in extra_stylesheets %}
|
28
28
|
<link rel="stylesheet"
|
29
|
-
href="{{ ss.href }}"
|
29
|
+
href="{{ ss.href | relative_url }}"
|
30
30
|
{% if ss.integrity %}integrity="{{ ss.integrity }}"{% endif %}
|
31
31
|
{% if ss.crossorigin %}crossorigin="{{ ss.crossorigin }}"{% endif %}>
|
32
32
|
{% endfor %}
|
data/_includes/script.html
CHANGED
@@ -13,7 +13,22 @@
|
|
13
13
|
};
|
14
14
|
|
15
15
|
var replace_math_symb = function(s){
|
16
|
-
|
16
|
+
// replace mathjax
|
17
|
+
mathjax_containers = s.querySelectorAll('math, mjx-container');
|
18
|
+
|
19
|
+
if(mathjax_containers.length > 0) {
|
20
|
+
s = s.cloneNode(true);
|
21
|
+
s.querySelectorAll('math, mjx-container').forEach(container => {
|
22
|
+
container.replaceWith('<<math_symbol>>');
|
23
|
+
});
|
24
|
+
}
|
25
|
+
|
26
|
+
text = s.innerText;
|
27
|
+
|
28
|
+
// replace asciimath
|
29
|
+
text = text.replace(/(`[^`]+`)/g, '<<math_symbol>>');
|
30
|
+
|
31
|
+
return text;
|
17
32
|
};
|
18
33
|
|
19
34
|
var copyBtn = d.getElementById('engTermCopy');
|
@@ -43,7 +58,7 @@
|
|
43
58
|
for (var _elm of elmsToCopy) {
|
44
59
|
if (_elm.innerText.trim().length > 0) {
|
45
60
|
// textToCopy = textToCopy + _elm.innerText + '\r\n\r\n';
|
46
|
-
textToCopy = textToCopy + replace_math_symb(_elm
|
61
|
+
textToCopy = textToCopy + replace_math_symb(_elm) + '\r\n\r\n';
|
47
62
|
};
|
48
63
|
};
|
49
64
|
|
data/_layouts/custom-home.html
CHANGED
@@ -17,7 +17,7 @@ extra_scripts:
|
|
17
17
|
|
18
18
|
<section class="browse-concepts">
|
19
19
|
<h2 class="section-title">Concepts</h2>
|
20
|
-
<a href="/concepts/" class="browse-concepts">Browse concepts</a>
|
20
|
+
<a href="{{ '/concepts/' | relative_url }}" class="browse-concepts">Browse concepts</a>
|
21
21
|
</section>
|
22
22
|
|
23
23
|
{{ content }}
|
data/_layouts/default.html
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
<header class="{% if site.has_brand_name %}brand{% endif %}">
|
10
10
|
<div class="site-headline">
|
11
11
|
<div class="parent-org-reference">
|
12
|
-
<a href="/" class="logo-link">
|
12
|
+
<a href="{{ '/' | relative_url }}" class="logo-link">
|
13
13
|
<img src="{{ site.committee.main_logo.path | relative_url }}" alt="{{ site.committee.main_logo.alt_text }}">
|
14
14
|
</a>
|
15
15
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
{% if extra_scripts %}
|
125
125
|
{% for sc in extra_scripts %}
|
126
126
|
<script
|
127
|
-
src="{{ sc.src }}"
|
127
|
+
src="{{ sc.src | relative_url }}"
|
128
128
|
{% if sc.integrity %}integrity="{{ sc.integrity }}"{% endif %}
|
129
129
|
{% if sc.crossorigin %}crossorigin="{{ sc.crossorigin }}"{% endif %}></script>
|
130
130
|
{% endfor %}
|
@@ -8,7 +8,7 @@ permalink: "/api/concept-search-index.json"
|
|
8
8
|
json.array! site["concepts"].each_with_index.to_a do |(concept, idx)|
|
9
9
|
json.termid concept.termid
|
10
10
|
json.term concept.data.dig("eng", "terms", 0, "designation")
|
11
|
-
json.term_url concept.url
|
11
|
+
json.term_url "#{site["baseurl"]}#{concept.url}"
|
12
12
|
|
13
13
|
json.sort_order do
|
14
14
|
json.natural idx + 1 # loop index, indexing from 1
|
@@ -26,7 +26,7 @@ json.array! site["concepts"].each_with_index.to_a do |(concept, idx)|
|
|
26
26
|
|
27
27
|
json.term localized.dig("terms", 0, "designation")
|
28
28
|
json.id localized["id"]
|
29
|
-
json.term_url "#{concept.url}#entry-lang-#{lang}"
|
29
|
+
json.term_url "#{site["baseurl"]}#{concept.url}#entry-lang-#{lang}"
|
30
30
|
json.entry_status concept["status"]
|
31
31
|
json.language_code localized["language_code"]
|
32
32
|
json.review_decision english["review_decision"]
|
@@ -12,8 +12,11 @@ for concept_page in site["concepts"]
|
|
12
12
|
json.set! concept_page.termid.to_s do
|
13
13
|
json.term concept_page.data["term"]
|
14
14
|
json.termid concept_page.termid
|
15
|
-
json.set! "uri-html", concept_page.url
|
16
|
-
|
15
|
+
json.set! "uri-html", "#{site["baseurl"]}#{concept_page.url}"
|
16
|
+
|
17
|
+
if concept_json_page&.url
|
18
|
+
json.set! "uri-json", "#{site["baseurl"]}#{concept_json_page.url}"
|
19
|
+
end
|
17
20
|
end
|
18
21
|
end
|
19
22
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
---
|
2
2
|
---
|
3
|
-
importScripts('/assets/js/babel-polyfill.js');
|
3
|
+
importScripts("{{ '/assets/js/babel-polyfill.js' | relative_url }}");
|
4
4
|
|
5
|
-
const CONCEPTS_URL = '/api/concept-search-index.json';
|
5
|
+
const CONCEPTS_URL = "{{ '/api/concept-search-index.json' | relative_url }}";
|
6
6
|
|
7
7
|
/** For example:
|
8
8
|
* const LANGUAGES = [ 'eng', 'deu' ];
|
data/assets/js/concept-search.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
---
|
3
3
|
(function () {
|
4
4
|
|
5
|
-
const searchWorker = new Worker('/assets/js/concept-search-worker.js');
|
5
|
+
const searchWorker = new Worker("{{ '/assets/js/concept-search-worker.js' | relative_url }}");
|
6
6
|
|
7
7
|
/** For example:
|
8
8
|
* const LANGUAGES = [ 'eng', 'deu' ];
|
@@ -231,7 +231,7 @@
|
|
231
231
|
);
|
232
232
|
}
|
233
233
|
headerEls.push(el('span', { key: 'title' }, 'Find a concept'));
|
234
|
-
headerEls.push(el('a', { key: 'link', href: '/concepts' }, '(browse all)'));
|
234
|
+
headerEls.push(el('a', { key: 'link', href: "{{ '/concepts' | relative_url }}" }, '(browse all)'));
|
235
235
|
|
236
236
|
var els = [
|
237
237
|
el('h2', { key: 'section-title', className: 'section-title' }, headerEls),
|
data/jekyll-geolexica.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
36
|
spec.require_paths = ["lib"]
|
37
37
|
|
38
|
-
spec.add_runtime_dependency "glossarist", "~> 2.0"
|
38
|
+
spec.add_runtime_dependency "glossarist", "~> 2.0.7"
|
39
39
|
# Jekyll 4.1.0 adds some breaking changes which are reverted in 4.1.1.
|
40
40
|
# I doubt we should be worried, but there is no good reason to allow them
|
41
41
|
# either.
|
@@ -47,6 +47,8 @@ Gem::Specification.new do |spec|
|
|
47
47
|
# Pin logger to <= 1.5.3 due to incompatibility of logger 1.6.0 with Jekyll 4.3.2
|
48
48
|
spec.add_runtime_dependency "logger", "<= 1.5.3"
|
49
49
|
spec.add_runtime_dependency "relaton"
|
50
|
+
spec.add_runtime_dependency "unitsml"
|
51
|
+
spec.add_runtime_dependency "plurimath"
|
50
52
|
|
51
53
|
# Zeitwerk::Loader#push_dir supports :namespace argument from v. 2.4.
|
52
54
|
spec.add_runtime_dependency "zeitwerk", "~> 2.4"
|
@@ -25,6 +25,7 @@ module Jekyll
|
|
25
25
|
"id" => managed_concept.uuid,
|
26
26
|
"term" => managed_concept.default_designation,
|
27
27
|
"termid" => managed_concept.id,
|
28
|
+
"status" => managed_concept.status,
|
28
29
|
}.merge(managed_concept.to_h)
|
29
30
|
|
30
31
|
managed_concept.localizations.each do |lang, localization|
|
@@ -11,6 +11,7 @@ module Jekyll
|
|
11
11
|
hook :post_read, :site, :load_glossary
|
12
12
|
hook :pre_render, :documents, :expose_glossary
|
13
13
|
hook :pre_render, :pages, :expose_glossary
|
14
|
+
hook :post_render, :pages, :convert_math
|
14
15
|
end
|
15
16
|
|
16
17
|
# Adds Jekyll::Site#glossary method, and initializes an empty glossary.
|
@@ -28,6 +29,26 @@ module Jekyll
|
|
28
29
|
liquid_drop["glossary"] = page_or_document.site.glossary
|
29
30
|
end
|
30
31
|
|
32
|
+
def convert_math(page)
|
33
|
+
page.output.gsub!(/stem:\[([^\]]*?)\]/) do
|
34
|
+
ascii_equation = CGI.unescapeHTML(Regexp.last_match[1])
|
35
|
+
|
36
|
+
mathml_equation = ::Plurimath::Math
|
37
|
+
.parse(ascii_equation, :asciimath)
|
38
|
+
.to_mathml
|
39
|
+
|
40
|
+
# temporary hack to use display inline for math equations because
|
41
|
+
# currently there is no option to use display inline in plurimath
|
42
|
+
mathml_equation.gsub!("display=\"block\"", "display=\"inline\"")
|
43
|
+
|
44
|
+
# Removing newlines(\n) and escaping double quotes(")
|
45
|
+
# because they will cause parsing issues in json
|
46
|
+
mathml_equation.gsub!("\n", "").gsub!("\"", "\\\"") unless page.html?
|
47
|
+
|
48
|
+
mathml_equation
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
31
52
|
def hook event, target, action
|
32
53
|
Jekyll::Hooks.register target, event, &method(action)
|
33
54
|
end
|
data/lib/jekyll/geolexica.rb
CHANGED
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.2
|
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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glossarist
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.7
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,6 +106,34 @@ dependencies:
|
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: unitsml
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
type: :runtime
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: plurimath
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
type: :runtime
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
109
137
|
- !ruby/object:Gem::Dependency
|
110
138
|
name: zeitwerk
|
111
139
|
requirement: !ruby/object:Gem::Requirement
|