metanorma 2.0.9 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8023ee9f3e35c8192af2ef0cd4231b635b5efc6e5529fe85acb42a641032b3b0
4
- data.tar.gz: 2875b07c0f94091745d83cea071d96bcffe1a77b5f493eda45970bc7ff3c580b
3
+ metadata.gz: 7fa8deddc619f4709beefe82cce7b877ea9402963b037b9c84770b3ca0c14a90
4
+ data.tar.gz: 185080156bee2c43d4a5b87e0bd0ba4925569e94c2f19eeeed2e82d6bb563ec3
5
5
  SHA512:
6
- metadata.gz: fae6f061d8fb94d44671e372d802190d205058073a389534241f7958aafe0a0c49e87e75e46cd205d4c9ea227e5c4610f9f4ca430849c084a2493eacdca8419f
7
- data.tar.gz: a7fa6dcb6a2b379bbc3e6b8de6b4d3f300c0b5e01f40dc79fa784a535f6041d29913b4c904adc3a98e7c8d90ba88ff008e4700549b6c5d397242b33a85040092
6
+ metadata.gz: fe6ac88b648d30a9f82c5d5bc9b4c14b021204126fc5513772bfa2263519c767e19a395ca26d4f82f2cbd41ca014549d3919b4083832cd282865a70a4105064c
7
+ data.tar.gz: f3937b78290728d24cbd89245f696c6163ff60f2e4b1b0bc645fa63aec27673d971484a507b15101b1a1c7e3b4b86442c4edf6784913873b5cceed931e7a948c
@@ -106,11 +106,20 @@ module Metanorma
106
106
  end
107
107
  end
108
108
 
109
+ def select_citation_uri(bib, lang)
110
+ bib or return
111
+ url = bib.at(ns("./uri[@type = 'citation']" \
112
+ "[@language = '#{lang}']")) ||
113
+ bib.at(ns("./uri[@type = 'citation']"))
114
+ url&.text
115
+ end
116
+
109
117
  def eref_to_internal_eref(section, xml, key)
110
- bibitems, indirect, bibids = eref_to_internal_eref_prep(section, xml)
118
+ bibitems, indirect, bibids, lang =
119
+ eref_to_internal_eref_prep(section, xml)
111
120
  eref_to_internal_eref_select(section, xml, bibitems)
112
121
  .each_with_object([]) do |x, m|
113
- url = bibitems[x]&.at(ns("./uri[@type = 'citation']"))&.text
122
+ url = select_citation_uri(bibitems[x], lang)
114
123
  bibids[x]&.each do |e|
115
124
  e.at(ns("./localityStack | ./locality")) and next
116
125
  id = eref_to_internal_eref1(e, key, url, indirect) and m << id
@@ -124,7 +133,8 @@ module Metanorma
124
133
  indirect = ::Metanorma::Collection::Util::gather_bibitems(xml)
125
134
  .select { |_, v| indirect_bib?(v) }
126
135
  bibitemids = ::Metanorma::Collection::Util::gather_bibitemids(section)
127
- [bibitems, indirect, bibitemids]
136
+ lang = xml.at(ns("//bibdata/language"))&.text || "en"
137
+ [bibitems, indirect, bibitemids, lang]
128
138
  end
129
139
 
130
140
  def eref_to_internal_eref1(elem, key, url, indirect)
@@ -73,6 +73,8 @@ module Metanorma
73
73
 
74
74
  def get_isodoc_options(file, options, ext)
75
75
  ret = @processor.extract_options(file)
76
+ dir = options[:filename].sub(%r(/[^/]+$), "/")
77
+ ret[:i18nyaml] &&= File.join(dir, ret[:i18nyaml])
76
78
  copy_isodoc_options_attrs(options, ret)
77
79
  font_manifest_mn2pdf(options, ret, ext)
78
80
  ret[:output_formats]&.select! do |k, _|
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "2.0.9".freeze
2
+ VERSION = "2.0.11".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
11
+ date: 2025-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -343,7 +343,7 @@ homepage: https://github.com/metanorma/metanorma
343
343
  licenses:
344
344
  - BSD-2-Clause
345
345
  metadata: {}
346
- post_install_message:
346
+ post_install_message:
347
347
  rdoc_options: []
348
348
  require_paths:
349
349
  - lib
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  version: '0'
360
360
  requirements: []
361
361
  rubygems_version: 3.3.27
362
- signing_key:
362
+ signing_key:
363
363
  specification_version: 4
364
364
  summary: Metanorma is the standard of standards; the metanorma gem allows you to create
365
365
  any standard document type supported by Metanorma.