metanorma-mpfa 0.6.1 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/bin/manifest +43 -42
- data/lib/asciidoctor/mpfa/biblio.rng +1 -0
- data/lib/asciidoctor/mpfa/isodoc.rng +209 -4
- data/lib/asciidoctor/mpfa/mpfd.rng +3 -0
- data/lib/isodoc/mpfa/init.rb +1 -2
- data/lib/isodoc/mpfa/metadata.rb +14 -14
- data/lib/isodoc/mpfa/mpfa.circular.xsl +560 -81
- data/lib/isodoc/mpfa/mpfa.compliance-standards-for-mpf-trustees.xsl +560 -81
- data/lib/isodoc/mpfa/mpfa.guidelines.xsl +560 -81
- data/lib/isodoc/mpfa/mpfa.standards.xsl +560 -81
- data/lib/isodoc/mpfa/mpfa.supervision-of-mpf-intermediaries.xsl +560 -81
- data/lib/isodoc/mpfa/xref.rb +28 -24
- data/lib/metanorma/mpfa/version.rb +1 -1
- data/metanorma-mpfd.gemspec +3 -3
- metadata +7 -7
data/lib/isodoc/mpfa/xref.rb
CHANGED
@@ -3,18 +3,18 @@ module IsoDoc
|
|
3
3
|
class Xref < IsoDoc::Xref
|
4
4
|
FRONT_CLAUSE = "//*[parent::preface]".freeze
|
5
5
|
|
6
|
-
def initial_anchor_names(
|
7
|
-
|
6
|
+
def initial_anchor_names(doc)
|
7
|
+
doc.xpath(ns(self.class::FRONT_CLAUSE)).each do |c|
|
8
8
|
preface_names(c)
|
9
9
|
sequential_asset_names(c)
|
10
10
|
end
|
11
|
-
middle_section_asset_names(
|
12
|
-
clause_names(
|
13
|
-
termnote_anchor_names(
|
14
|
-
termexample_anchor_names(
|
11
|
+
middle_section_asset_names(doc)
|
12
|
+
clause_names(doc, 0)
|
13
|
+
termnote_anchor_names(doc)
|
14
|
+
termexample_anchor_names(doc)
|
15
15
|
end
|
16
16
|
|
17
|
-
def annex_name_lbl(
|
17
|
+
def annex_name_lbl(_clause, num)
|
18
18
|
l10n("<strong>#{@labels['annex']} #{num}</strong>")
|
19
19
|
end
|
20
20
|
|
@@ -31,20 +31,20 @@ module IsoDoc
|
|
31
31
|
def container_names(clause, lvl)
|
32
32
|
if clause["container"]
|
33
33
|
@anchors[clause["id"]] =
|
34
|
-
{ label: nil, xref: clause.at(ns("./title"))&.text, level: lvl+1 }
|
34
|
+
{ label: nil, xref: clause.at(ns("./title"))&.text, level: lvl + 1 }
|
35
35
|
end
|
36
36
|
clause.xpath(ns("./clause | ./term | ./terms | "\
|
37
37
|
"./definitions")).each do |c|
|
38
|
-
container_names(c, clause["container"] ? lvl+1 : lvl)
|
38
|
+
container_names(c, clause["container"] ? lvl + 1 : lvl)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def sect_names(clause, num, i, lvl,
|
42
|
+
def sect_names(clause, num, i, lvl, _prev_lvl)
|
43
43
|
return i if clause.nil?
|
44
|
+
|
44
45
|
curr = i
|
45
46
|
if !clause["container"]
|
46
|
-
|
47
|
-
i+=1
|
47
|
+
i += 1
|
48
48
|
curr = i
|
49
49
|
name = num.nil? ? i.to_s : "#{num}.#{i}"
|
50
50
|
@anchors[clause["id"]] = { label: name, level: lvl + 1,
|
@@ -57,28 +57,29 @@ module IsoDoc
|
|
57
57
|
if clause["container"]
|
58
58
|
i, lvl = sect_names(c, num, i, lvl, lvl)
|
59
59
|
else
|
60
|
-
j, prev = sect_names(c, name, j, lvl+1, prev)
|
60
|
+
j, prev = sect_names(c, name, j, lvl + 1, prev)
|
61
61
|
end
|
62
62
|
end
|
63
|
-
i = j if j
|
63
|
+
i = j if j.positive?
|
64
64
|
i = curr if lvl < prev
|
65
65
|
[i, prev]
|
66
66
|
end
|
67
67
|
|
68
|
-
def annex_naming(
|
69
|
-
if
|
68
|
+
def annex_naming(clause, num, lvl, idx)
|
69
|
+
if clause["guidance"] then annex_names1(clause, "#{num}E", lvl + 1)
|
70
70
|
else
|
71
|
-
|
72
|
-
annex_names1(
|
71
|
+
idx += 1 unless clause["container"]
|
72
|
+
annex_names1(clause, "#{num}.#{idx}", lvl + 1)
|
73
73
|
end
|
74
|
-
|
74
|
+
idx
|
75
75
|
end
|
76
76
|
|
77
77
|
def annex_names(clause, num)
|
78
|
-
@anchors[clause["id"]] =
|
79
|
-
|
78
|
+
@anchors[clause["id"]] =
|
79
|
+
{ label: annex_name_lbl(clause, num), value: num,
|
80
|
+
xref: l10n("#{@labels['annex']} #{num}"), level: 1 }
|
80
81
|
if a = single_annex_special_section(clause)
|
81
|
-
annex_names1(a,
|
82
|
+
annex_names1(a, num.to_s, 1)
|
82
83
|
else
|
83
84
|
i = 0
|
84
85
|
clause.xpath(ns("./clause | ./references")).each do |c|
|
@@ -90,8 +91,11 @@ module IsoDoc
|
|
90
91
|
end
|
91
92
|
|
92
93
|
def annex_names1(clause, num, level)
|
93
|
-
clause["container"]
|
94
|
-
|
94
|
+
unless clause["container"]
|
95
|
+
@anchors[clause["id"]] =
|
96
|
+
{ label: num,
|
97
|
+
xref: l10n("#{@labels['annex']} #{num}"), level: level }
|
98
|
+
end
|
95
99
|
i = 0
|
96
100
|
clause.xpath(ns("./clause | ./references")).each do |c|
|
97
101
|
i = annex_naming(c, num, level, i)
|
data/metanorma-mpfd.gemspec
CHANGED
@@ -26,11 +26,11 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.bindir = "exe"
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
29
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
30
30
|
|
31
31
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
32
|
-
spec.add_dependency "isodoc", "~> 1.
|
33
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
32
|
+
spec.add_dependency "isodoc", "~> 1.7.0"
|
33
|
+
spec.add_dependency "metanorma-standoc", "~> 1.10.0"
|
34
34
|
spec.add_dependency "twitter_cldr"
|
35
35
|
|
36
36
|
spec.add_development_dependency "byebug", "~> 9.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-mpfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.7.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: metanorma-standoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.10.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.10.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: twitter_cldr
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -290,7 +290,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
290
290
|
requirements:
|
291
291
|
- - ">="
|
292
292
|
- !ruby/object:Gem::Version
|
293
|
-
version: 2.
|
293
|
+
version: 2.5.0
|
294
294
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
295
295
|
requirements:
|
296
296
|
- - ">="
|