metanorma-iho 0.5.0 → 0.5.4
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/html/htmlstyle.css +22 -17
- data/lib/isodoc/iho/html/htmlstyle.scss +8 -2
- data/lib/isodoc/iho/html/iho.css +1 -2
- data/lib/isodoc/iho/html/iho.scss +0 -1
- data/lib/isodoc/iho/iho.specification.xsl +2191 -1311
- data/lib/isodoc/iho/iho.standard.xsl +2191 -1311
- data/lib/isodoc/iho/xref.rb +33 -30
- data/lib/metanorma/iho/basicdoc.rng +5 -3
- data/lib/metanorma/iho/biblio.rng +7 -5
- data/lib/metanorma/iho/isodoc.rng +142 -4
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
data/lib/isodoc/iho/xref.rb
CHANGED
@@ -6,25 +6,27 @@ module IsoDoc
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class Xref < IsoDoc::Generic::Xref
|
9
|
+
def annexlbl(cond)
|
10
|
+
cond ? @labels["appendix"] : @labels["annex"]
|
11
|
+
end
|
12
|
+
|
9
13
|
def annex_name_lbl(clause, num)
|
10
|
-
lbl = clause["obligation"] == "informative"
|
11
|
-
@labels["appendix"] : @labels["annex"]
|
14
|
+
lbl = annexlbl(clause["obligation"] == "informative")
|
12
15
|
l10n("<strong>#{lbl} #{num}</strong>")
|
13
16
|
end
|
14
17
|
|
15
18
|
def annex_names(clause, num)
|
16
19
|
appendix_names(clause, num)
|
17
|
-
lbl = clause["obligation"] == "informative"
|
18
|
-
@labels["appendix"] : @labels["annex"]
|
20
|
+
lbl = annexlbl(clause["obligation"] == "informative")
|
19
21
|
@anchors[clause["id"]] =
|
20
|
-
{ label: annex_name_lbl(clause, num), type: "clause",
|
21
|
-
xref: l10n("#{lbl} #{num}"), level: 1, value:
|
22
|
+
{ label: annex_name_lbl(clause, num), type: "clause", elem: lbl,
|
23
|
+
xref: l10n("#{lbl} #{num}"), level: 1, value: num }
|
22
24
|
if a = single_annex_special_section(clause)
|
23
|
-
annex_names1(a,
|
25
|
+
annex_names1(a, num.to_s, 1)
|
24
26
|
else
|
25
27
|
i = Counter.new
|
26
|
-
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
|
27
|
-
each do |c|
|
28
|
+
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
|
29
|
+
.each do |c|
|
28
30
|
i.increment(c)
|
29
31
|
annex_names1(c, "#{num}.#{i.print}", 2)
|
30
32
|
end
|
@@ -35,36 +37,36 @@ module IsoDoc
|
|
35
37
|
def back_anchor_names(docxml)
|
36
38
|
super
|
37
39
|
i = Counter.new
|
38
|
-
docxml.xpath(ns("//annex[@obligation = 'informative']"))
|
39
|
-
each do |c|
|
40
|
+
docxml.xpath(ns("//annex[@obligation = 'informative']"))
|
41
|
+
.each do |c|
|
40
42
|
i.increment(c)
|
41
43
|
annex_names(c, i.print)
|
42
44
|
end
|
43
45
|
i = Counter.new("@", skip_i: true)
|
44
|
-
docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
|
45
|
-
each do |c|
|
46
|
+
docxml.xpath(ns("//annex[not(@obligation = 'informative')]"))
|
47
|
+
.each do |c|
|
46
48
|
i.increment(c)
|
47
49
|
annex_names(c, i.print)
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
51
53
|
def annex_names1(clause, num, level)
|
52
|
-
lbl = clause.at("./ancestor::xmlns:annex/@obligation")
|
53
|
-
|
54
|
+
lbl = annexlbl(clause.at("./ancestor::xmlns:annex/@obligation")
|
55
|
+
.text == "informative")
|
54
56
|
@anchors[clause["id"]] =
|
55
57
|
{ label: num, xref: l10n("#{lbl} #{num}"),
|
56
58
|
level: level, type: "clause" }
|
57
|
-
|
58
|
-
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
|
59
|
-
each do |c|
|
59
|
+
i = Counter.new
|
60
|
+
clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
|
61
|
+
.each do |c|
|
60
62
|
i.increment(c)
|
61
63
|
annex_names1(c, "#{num}.#{i.print}", level + 1)
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
65
|
-
def appendix_names(clause,
|
66
|
-
|
67
|
-
clause.xpath(ns("./appendix")).
|
67
|
+
def appendix_names(clause, _num)
|
68
|
+
i = Counter.new
|
69
|
+
clause.xpath(ns("./appendix")).each do |c|
|
68
70
|
i.increment(c)
|
69
71
|
@anchors[c["id"]] =
|
70
72
|
anchor_struct(i.print, nil, @labels["appendix"], "clause")
|
@@ -73,16 +75,17 @@ module IsoDoc
|
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
78
|
+
def section_names1(clause, num, level)
|
79
|
+
@anchors[clause["id"]] =
|
80
|
+
{ label: num, level: level,
|
81
|
+
xref: l10n("#{@labels['subclause']} #{num}"),
|
82
|
+
type: "clause", elem: @labels["subclause"] }
|
83
|
+
i = Counter.new
|
84
|
+
clause.xpath(ns(SUBCLAUSES)).each do |c|
|
85
|
+
i.increment(c)
|
86
|
+
section_names1(c, "#{num}.#{i.print}", level + 1)
|
87
|
+
end
|
84
88
|
end
|
85
89
|
end
|
86
|
-
end
|
87
90
|
end
|
88
91
|
end
|
@@ -173,9 +173,11 @@
|
|
173
173
|
<data type="dateTime"/>
|
174
174
|
</attribute>
|
175
175
|
</optional>
|
176
|
-
<
|
177
|
-
<
|
178
|
-
|
176
|
+
<optional>
|
177
|
+
<attribute name="from">
|
178
|
+
<data type="IDREF"/>
|
179
|
+
</attribute>
|
180
|
+
</optional>
|
179
181
|
<optional>
|
180
182
|
<attribute name="to">
|
181
183
|
<data type="IDREF"/>
|
@@ -209,9 +209,6 @@
|
|
209
209
|
<zeroOrMore>
|
210
210
|
<ref name="contact"/>
|
211
211
|
</zeroOrMore>
|
212
|
-
<zeroOrMore>
|
213
|
-
<ref name="uri"/>
|
214
|
-
</zeroOrMore>
|
215
212
|
</element>
|
216
213
|
</define>
|
217
214
|
<define name="fullname">
|
@@ -401,9 +398,9 @@
|
|
401
398
|
<choice>
|
402
399
|
<!-- iso191606 TODO -->
|
403
400
|
<group>
|
404
|
-
<
|
401
|
+
<zeroOrMore>
|
405
402
|
<ref name="street"/>
|
406
|
-
</
|
403
|
+
</zeroOrMore>
|
407
404
|
<ref name="city"/>
|
408
405
|
<optional>
|
409
406
|
<ref name="state"/>
|
@@ -828,6 +825,11 @@
|
|
828
825
|
<optional>
|
829
826
|
<attribute name="scope"/>
|
830
827
|
</optional>
|
828
|
+
<optional>
|
829
|
+
<attribute name="primary">
|
830
|
+
<data type="boolean"/>
|
831
|
+
</attribute>
|
832
|
+
</optional>
|
831
833
|
<text/>
|
832
834
|
</element>
|
833
835
|
</define>
|
@@ -32,6 +32,43 @@
|
|
32
32
|
<ref name="DocumentType"/>
|
33
33
|
</element>
|
34
34
|
</define>
|
35
|
+
<define name="index">
|
36
|
+
<element name="index">
|
37
|
+
<optional>
|
38
|
+
<attribute name="to">
|
39
|
+
<data type="IDREF"/>
|
40
|
+
</attribute>
|
41
|
+
</optional>
|
42
|
+
<element name="primary">
|
43
|
+
<oneOrMore>
|
44
|
+
<choice>
|
45
|
+
<ref name="PureTextElement"/>
|
46
|
+
<ref name="stem"/>
|
47
|
+
</choice>
|
48
|
+
</oneOrMore>
|
49
|
+
</element>
|
50
|
+
<optional>
|
51
|
+
<element name="secondary">
|
52
|
+
<oneOrMore>
|
53
|
+
<choice>
|
54
|
+
<ref name="PureTextElement"/>
|
55
|
+
<ref name="stem"/>
|
56
|
+
</choice>
|
57
|
+
</oneOrMore>
|
58
|
+
</element>
|
59
|
+
</optional>
|
60
|
+
<optional>
|
61
|
+
<element name="tertiary">
|
62
|
+
<oneOrMore>
|
63
|
+
<choice>
|
64
|
+
<ref name="PureTextElement"/>
|
65
|
+
<ref name="stem"/>
|
66
|
+
</choice>
|
67
|
+
</oneOrMore>
|
68
|
+
</element>
|
69
|
+
</optional>
|
70
|
+
</element>
|
71
|
+
</define>
|
35
72
|
<define name="bibitem">
|
36
73
|
<element name="bibitem">
|
37
74
|
<attribute name="id">
|
@@ -115,9 +152,7 @@
|
|
115
152
|
<data type="boolean"/>
|
116
153
|
</attribute>
|
117
154
|
</optional>
|
118
|
-
<
|
119
|
-
<ref name="PureTextElement"/>
|
120
|
-
</oneOrMore>
|
155
|
+
<ref name="XrefBody"/>
|
121
156
|
</element>
|
122
157
|
</define>
|
123
158
|
<define name="erefType">
|
@@ -151,6 +186,42 @@
|
|
151
186
|
<ref name="PureTextElement"/>
|
152
187
|
</oneOrMore>
|
153
188
|
</define>
|
189
|
+
<define name="localityStack">
|
190
|
+
<element name="localityStack">
|
191
|
+
<optional>
|
192
|
+
<attribute name="connective">
|
193
|
+
<choice>
|
194
|
+
<value>and</value>
|
195
|
+
<value>or</value>
|
196
|
+
<value>from</value>
|
197
|
+
<value>to</value>
|
198
|
+
<value/>
|
199
|
+
</choice>
|
200
|
+
</attribute>
|
201
|
+
</optional>
|
202
|
+
<zeroOrMore>
|
203
|
+
<ref name="locality"/>
|
204
|
+
</zeroOrMore>
|
205
|
+
</element>
|
206
|
+
</define>
|
207
|
+
<define name="sourceLocalityStack">
|
208
|
+
<element name="sourceLocalityStack">
|
209
|
+
<optional>
|
210
|
+
<attribute name="connective">
|
211
|
+
<choice>
|
212
|
+
<value>and</value>
|
213
|
+
<value>or</value>
|
214
|
+
<value>from</value>
|
215
|
+
<value>to</value>
|
216
|
+
<value/>
|
217
|
+
</choice>
|
218
|
+
</attribute>
|
219
|
+
</optional>
|
220
|
+
<zeroOrMore>
|
221
|
+
<ref name="sourceLocality"/>
|
222
|
+
</zeroOrMore>
|
223
|
+
</element>
|
224
|
+
</define>
|
154
225
|
<define name="ul">
|
155
226
|
<element name="ul">
|
156
227
|
<attribute name="id">
|
@@ -1027,6 +1098,26 @@
|
|
1027
1098
|
</zeroOrMore>
|
1028
1099
|
</element>
|
1029
1100
|
</define>
|
1101
|
+
<define name="sub">
|
1102
|
+
<element name="sub">
|
1103
|
+
<zeroOrMore>
|
1104
|
+
<choice>
|
1105
|
+
<ref name="PureTextElement"/>
|
1106
|
+
<ref name="stem"/>
|
1107
|
+
</choice>
|
1108
|
+
</zeroOrMore>
|
1109
|
+
</element>
|
1110
|
+
</define>
|
1111
|
+
<define name="sup">
|
1112
|
+
<element name="sup">
|
1113
|
+
<zeroOrMore>
|
1114
|
+
<choice>
|
1115
|
+
<ref name="PureTextElement"/>
|
1116
|
+
<ref name="stem"/>
|
1117
|
+
</choice>
|
1118
|
+
</zeroOrMore>
|
1119
|
+
</element>
|
1120
|
+
</define>
|
1030
1121
|
<define name="pagebreak">
|
1031
1122
|
<element name="pagebreak">
|
1032
1123
|
<optional>
|
@@ -1041,6 +1132,16 @@
|
|
1041
1132
|
</define>
|
1042
1133
|
</include>
|
1043
1134
|
<!-- end overrides -->
|
1135
|
+
<define name="image" combine="choice">
|
1136
|
+
<element name="svg">
|
1137
|
+
<oneOrMore>
|
1138
|
+
<choice>
|
1139
|
+
<text/>
|
1140
|
+
<ref name="AnyElement"/>
|
1141
|
+
</choice>
|
1142
|
+
</oneOrMore>
|
1143
|
+
</element>
|
1144
|
+
</define>
|
1044
1145
|
<define name="MultilingualRenderingType">
|
1045
1146
|
<choice>
|
1046
1147
|
<value>common</value>
|
@@ -2216,7 +2317,18 @@
|
|
2216
2317
|
<ref name="MultilingualRenderingType"/>
|
2217
2318
|
</attribute>
|
2218
2319
|
</optional>
|
2219
|
-
<
|
2320
|
+
<oneOrMore>
|
2321
|
+
<choice>
|
2322
|
+
<ref name="formula"/>
|
2323
|
+
<ref name="ul"/>
|
2324
|
+
<ref name="ol"/>
|
2325
|
+
<ref name="dl"/>
|
2326
|
+
<ref name="quote"/>
|
2327
|
+
<ref name="sourcecode"/>
|
2328
|
+
<ref name="paragraph"/>
|
2329
|
+
<ref name="figure"/>
|
2330
|
+
</choice>
|
2331
|
+
</oneOrMore>
|
2220
2332
|
</element>
|
2221
2333
|
</define>
|
2222
2334
|
<define name="termsource">
|
@@ -2563,4 +2675,30 @@
|
|
2563
2675
|
</zeroOrMore>
|
2564
2676
|
</element>
|
2565
2677
|
</define>
|
2678
|
+
<define name="XrefBody">
|
2679
|
+
<zeroOrMore>
|
2680
|
+
<ref name="XrefTarget"/>
|
2681
|
+
</zeroOrMore>
|
2682
|
+
<oneOrMore>
|
2683
|
+
<ref name="PureTextElement"/>
|
2684
|
+
</oneOrMore>
|
2685
|
+
</define>
|
2686
|
+
<define name="XrefTarget">
|
2687
|
+
<element name="location">
|
2688
|
+
<attribute name="target">
|
2689
|
+
<data type="string">
|
2690
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
2691
|
+
</data>
|
2692
|
+
</attribute>
|
2693
|
+
<attribute name="connective">
|
2694
|
+
<choice>
|
2695
|
+
<value>and</value>
|
2696
|
+
<value>or</value>
|
2697
|
+
<value>from</value>
|
2698
|
+
<value>to</value>
|
2699
|
+
<value/>
|
2700
|
+
</choice>
|
2701
|
+
</attribute>
|
2702
|
+
</element>
|
2703
|
+
</define>
|
2566
2704
|
</grammar>
|
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: 0.5.
|
4
|
+
version: 0.5.4
|
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-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|