mn-requirements 0.1.0 → 0.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: afda052b107a46deb4475c78df7261e3cfb708b4525372da5c00d71040aaabcd
|
|
4
|
+
data.tar.gz: 68c1ef39846359da8902e194495d105ebc767bbfc8284ab81946b49483b8be63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(": ")
|
|
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
|
|
71
|
-
"<
|
|
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] =
|
|
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}'>#{
|
|
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.
|
|
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
|
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.
|
|
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-
|
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: isodoc-i18n
|