metanorma-iho 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iho/iho.specification.xsl +562 -227
- data/lib/isodoc/iho/iho.standard.xsl +562 -227
- data/lib/isodoc/iho/init.rb +2 -2
- data/lib/isodoc/iho/presentation_xml_convert.rb +14 -9
- data/lib/isodoc/iho/xref.rb +36 -26
- data/lib/metanorma/iho/isodoc.rng +1 -1
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +1 -1
- metadata +4 -4
data/lib/isodoc/iho/init.rb
CHANGED
@@ -23,8 +23,8 @@ module IsoDoc
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def bibrenderer(options = {})
|
26
|
-
::Relaton::Render::Iho::General.new(options
|
27
|
-
|
26
|
+
::Relaton::Render::Iho::General.new(options
|
27
|
+
.merge(language: @lang, i18nhash: @i18n.get))
|
28
28
|
end
|
29
29
|
|
30
30
|
def info(isoxml, out)
|
@@ -18,15 +18,15 @@ _bib)
|
|
18
18
|
def middle_title(docxml); end
|
19
19
|
|
20
20
|
def preface_rearrange(doc)
|
21
|
-
preface_move(doc.
|
21
|
+
preface_move(doc.xpath(ns("//preface/abstract")),
|
22
22
|
%w(foreword executivesummary introduction clause acknowledgements), doc)
|
23
|
-
preface_move(doc.
|
23
|
+
preface_move(doc.xpath(ns("//preface/foreword")),
|
24
24
|
%w(executivesummary introduction clause acknowledgements), doc)
|
25
|
-
preface_move(doc.
|
25
|
+
preface_move(doc.xpath(ns("//preface/executivesummary")),
|
26
26
|
%w(introduction clause acknowledgements), doc)
|
27
|
-
preface_move(doc.
|
27
|
+
preface_move(doc.xpath(ns("//preface/introduction")),
|
28
28
|
%w(clause acknowledgements), doc)
|
29
|
-
preface_move(doc.
|
29
|
+
preface_move(doc.xpath(ns("//preface/acknowledgements")),
|
30
30
|
%w(), doc)
|
31
31
|
end
|
32
32
|
|
@@ -117,10 +117,6 @@ _bib)
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
def clausedelim
|
121
|
-
""
|
122
|
-
end
|
123
|
-
|
124
120
|
def omit_docid_prefix(prefix)
|
125
121
|
prefix == "IHO" and return true
|
126
122
|
super
|
@@ -139,6 +135,15 @@ _bib)
|
|
139
135
|
defn.elements.last << s
|
140
136
|
end
|
141
137
|
|
138
|
+
def clausedelim
|
139
|
+
""
|
140
|
+
end
|
141
|
+
|
142
|
+
def clause(docxml)
|
143
|
+
super
|
144
|
+
docxml.xpath(ns("//executivesummary | //appendix")).each { |x| clause1(x) }
|
145
|
+
end
|
146
|
+
|
142
147
|
include Init
|
143
148
|
end
|
144
149
|
end
|
data/lib/isodoc/iho/xref.rb
CHANGED
@@ -16,17 +16,19 @@ module IsoDoc
|
|
16
16
|
|
17
17
|
def annex_name_lbl(clause, num)
|
18
18
|
lbl = annexlbl(clause["obligation"] == "informative")
|
19
|
-
|
19
|
+
s = labelled_autonum(lbl, num)
|
20
|
+
l10n("<strong>#{s}</strong>")
|
20
21
|
end
|
21
22
|
|
22
23
|
def annex_names(clause, num)
|
23
|
-
|
24
|
-
|
24
|
+
lbl = semx(clause, num)
|
25
|
+
appendix_names(clause, lbl)
|
26
|
+
elem = annexlbl(clause["obligation"] == "informative")
|
25
27
|
@anchors[clause["id"]] =
|
26
|
-
{ label: annex_name_lbl(clause,
|
27
|
-
xref:
|
28
|
+
{ label: annex_name_lbl(clause, lbl), type: "clause", elem: elem,
|
29
|
+
xref: labelled_autonum(elem, lbl), level: 1, value: num }
|
28
30
|
annex_names_recurse(clause, num)
|
29
|
-
annex_asset_names(clause, num,
|
31
|
+
annex_asset_names(clause, num, elem)
|
30
32
|
end
|
31
33
|
|
32
34
|
def annex_names_recurse(clause, num)
|
@@ -37,20 +39,25 @@ module IsoDoc
|
|
37
39
|
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
|
38
40
|
.each do |c|
|
39
41
|
i.increment(c)
|
40
|
-
annex_names1(c,
|
42
|
+
annex_names1(c, semx(clause, num), i.print, 2)
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
46
|
+
# avoid ambiguity of Table 1-1 being in Appendix 1 or Clause 1
|
44
47
|
def annex_asset_names(clause, num, lbl)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
+
#@annex_prefix = lbl
|
49
|
+
#require "debug"; binding.b
|
50
|
+
#hierarchical_asset_names(clause, num)
|
51
|
+
n = num
|
52
|
+
clause["obligation"] == "informative" and n = labelled_autonum(lbl, num)
|
53
|
+
hierarchical_asset_names(clause, n)
|
54
|
+
#@annex_prefix = nil
|
48
55
|
end
|
49
56
|
|
50
|
-
def anchor_struct_value(lbl, elem)
|
51
|
-
|
52
|
-
super
|
53
|
-
end
|
57
|
+
#def anchor_struct_value(lbl, elem)
|
58
|
+
#@annex_prefix and lbl = l10n("<span class='fmt-element-name'>#{@annex_prefix}</span> #{lbl}")
|
59
|
+
#super
|
60
|
+
#end
|
54
61
|
|
55
62
|
def clause_order_main(docxml)
|
56
63
|
if docxml.at(ns("//bibliography//references[@normative = 'true']")) ||
|
@@ -79,7 +86,7 @@ module IsoDoc
|
|
79
86
|
|
80
87
|
def annex_anchor_names(docxml)
|
81
88
|
clause_order_annex(docxml).each_with_index do |a, i|
|
82
|
-
n = i.zero? ? Counter.new("@"
|
89
|
+
n = i.zero? ? Counter.new("@") : Counter.new
|
83
90
|
docxml.xpath(ns(a[:path]))
|
84
91
|
.each do |c|
|
85
92
|
annex_names(c, n.increment(c).print)
|
@@ -88,16 +95,17 @@ module IsoDoc
|
|
88
95
|
end
|
89
96
|
end
|
90
97
|
|
91
|
-
def annex_names1(clause, num, level)
|
92
|
-
|
98
|
+
def annex_names1(clause, parentnum, num, level)
|
99
|
+
elem = annexlbl(clause.at("./ancestor::xmlns:annex/@obligation")
|
93
100
|
.text == "informative")
|
101
|
+
lbl = clause_number_semx(parentnum, clause, num)
|
94
102
|
@anchors[clause["id"]] =
|
95
|
-
{ label:
|
103
|
+
{ label: lbl, xref: labelled_autonum(elem, lbl),
|
96
104
|
level: level, type: "clause" }
|
97
|
-
i = Counter.new(0
|
105
|
+
i = Counter.new(0)
|
98
106
|
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
|
99
107
|
.each do |c|
|
100
|
-
annex_names1(c, i.increment(c).print, level + 1)
|
108
|
+
annex_names1(c, lbl, i.increment(c).print, level + 1)
|
101
109
|
end
|
102
110
|
end
|
103
111
|
|
@@ -106,20 +114,22 @@ module IsoDoc
|
|
106
114
|
clause.xpath(ns("./appendix")).each do |c|
|
107
115
|
i.increment(c)
|
108
116
|
@anchors[c["id"]] =
|
109
|
-
anchor_struct(i.print,
|
117
|
+
anchor_struct(i.print, c, @labels["appendix"], "clause", { container: true })
|
110
118
|
@anchors[c["id"]][:level] = 2
|
111
119
|
@anchors[c["id"]][:container] = clause["id"]
|
112
120
|
end
|
113
121
|
end
|
114
122
|
|
115
|
-
def section_names1(clause, num, level)
|
123
|
+
def section_names1(clause, parentnum, num, level)
|
124
|
+
lbl = clause_number_semx(parentnum, clause, num)
|
116
125
|
@anchors[clause["id"]] =
|
117
|
-
{ label:
|
118
|
-
xref: l10n("#{@labels['subclause']} #{num}"),
|
126
|
+
{ label: lbl, level: level,
|
127
|
+
#xref: l10n("#{@labels['subclause']} #{num}"),
|
128
|
+
xref: labelled_autonum(@labels['subclause'], lbl),
|
119
129
|
type: "clause", elem: @labels["subclause"] }
|
120
|
-
i = Counter.new(0
|
130
|
+
i = Counter.new(0)
|
121
131
|
clause.xpath(ns(SUBCLAUSES)).each do |c|
|
122
|
-
section_names1(c, i.increment(c).print, level + 1)
|
132
|
+
section_names1(c, lbl, i.increment(c).print, level + 1)
|
123
133
|
end
|
124
134
|
end
|
125
135
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.4.
|
20
|
+
<!-- VERSION v1.4.1 -->
|
21
21
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
data/metanorma-iho.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-generic", "~> 2.7.
|
30
|
+
spec.add_dependency "metanorma-generic", "~> 2.7.3"
|
31
31
|
|
32
32
|
spec.add_development_dependency "debug"
|
33
33
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
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-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.7.
|
19
|
+
version: 2.7.3
|
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: 2.7.
|
26
|
+
version: 2.7.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: debug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|