mn-requirements 0.1.0 → 0.1.1

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: d0e6c91b33ab3f3b3eb4ce26df120009dfe92441024891d766115421023630ea
4
- data.tar.gz: 800e1d60081b242bd3aa921004839ac0cabbcde5102a6d8c29d1d652e22b5cfc
3
+ metadata.gz: afda052b107a46deb4475c78df7261e3cfb708b4525372da5c00d71040aaabcd
4
+ data.tar.gz: 68c1ef39846359da8902e194495d105ebc767bbfc8284ab81946b49483b8be63
5
5
  SHA512:
6
- metadata.gz: ad9db2b90feb438a6e146cc943585ccaf81b525147b9556860f11175976e65c247b44d2d084cfcae43b9d89fbba7d9b7bab8fef00f5d2051ea7ed1fd450b0c77
7
- data.tar.gz: 4d875db98cb7ef2942ead616f49268314a12e592aecd5422b7f586fd98cf8fdf485d752e2fdf522dd9dc4640aab1f5e9e12e5c79dff6debbd9f17687396b3b32
6
+ metadata.gz: a467cdddb7c5bf675f7979d4b2d6a1581a21b0c76b30abbeec951cc0ab377088d7dea7efbb4e2195a6817e0d020a7311acad4eab2718bdddc209f931fb544796
7
+ data.tar.gz: c6bdc8ef9f159456a474a25476925d77497fe36809a69a63f9be9e712d4a9db86f25410d52e6850b1707c50f21a0a36f82beeea4e59007cff8a3aa49f028dc08
@@ -51,7 +51,7 @@ module Metanorma
51
51
  return ret unless title &&
52
52
  node.ancestors("requirement, recommendation, permission").empty?
53
53
 
54
- ret += l10n(": ") if name
54
+ ret += l10n(": ") unless !name || name.text.empty?
55
55
  ret += title.children.to_xml
56
56
  ret
57
57
  end
@@ -67,8 +67,8 @@ module Metanorma
67
67
 
68
68
  def recommend_title(node, out)
69
69
  label = node.at(ns("./identifier")) or return
70
- out.add_child("<tr><td>#{@labels['modspec']['identifier']}</td>"\
71
- "<td><tt>#{label.children.to_xml}</tt></td>")
70
+ out.add_child("<tr><td scope='colgroup' colspan='2'>"\
71
+ "<tt>#{label.children.to_xml}</tt></td>")
72
72
  end
73
73
 
74
74
  def recommendation_attributes1(node)
@@ -65,7 +65,8 @@ module Metanorma
65
65
  docxml.xpath(ns("//requirement | //recommendation | //permission"))
66
66
  .each_with_object({}) do |r, m|
67
67
  id = r.at(ns("./identifier")) or next
68
- m[id.text] = r["id"]
68
+ m[id.text] =
69
+ { id: r["id"], lbl: @xrefs.anchor(r["id"], :xref, false) }
69
70
  end
70
71
  end
71
72
 
@@ -77,7 +78,7 @@ module Metanorma
77
78
 
78
79
  subj = r.at(ns("./classification[tag = 'target']/value"))
79
80
  id = r.at(ns("./identifier")) or next
80
- lbl = @xrefs.anchor(@reqt_ids[id.text.strip], :xref, false)
81
+ lbl = @xrefs.anchor(@reqt_ids[id.text.strip][:id], :xref, false)
81
82
  next unless subj && lbl
82
83
 
83
84
  m[subj.text] = { lbl: lbl, id: r["id"] }
@@ -98,7 +99,7 @@ module Metanorma
98
99
  r.xpath(ns("./requirement | ./recommendation | ./permission"))
99
100
  .each do |r1|
100
101
  id1 = r1.at(ns("./identifier")) or next
101
- lbl = @xrefs.anchor(@reqt_ids[id.text.strip], :xref, false)
102
+ lbl = @xrefs.anchor(@reqt_ids[id.text.strip][:id], :xref, false)
102
103
  next unless lbl
103
104
 
104
105
  m[id1.text] = { lbl: lbl, id: r["id"] }
@@ -113,7 +114,7 @@ module Metanorma
113
114
 
114
115
  def recommendation_id(ident)
115
116
  test = @reqt_ids[ident&.strip] or return ident&.strip
116
- "<xref target='#{test}'>#{ident.strip}</xref>"
117
+ "<xref target='#{test[:id]}'>#{test[:lbl]}</xref>"
117
118
  end
118
119
  end
119
120
  end
@@ -11,7 +11,7 @@ module Metanorma
11
11
  @i18n = i18n_klass(options[:lang] || "en",
12
12
  options[:script] || "Latn",
13
13
  options[:i18nhash])
14
- @labels = @i18n.get.merge(options[:labels] || {})["requirements"]
14
+ @labels = @i18n.get.deep_merge(options[:labels] || {})["requirements"]
15
15
  @models = {}
16
16
  model_names.each { |k| @models[k] = create(k) }
17
17
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  class Requirements
3
- VERSION = "0.1.0".freeze
3
+ VERSION = "0.1.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mn-requirements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-30 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isodoc-i18n