metanorma-iso 2.9.0 → 2.9.2
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 +4 -4
- data/lib/isodoc/iso/base_convert.rb +27 -21
- data/lib/isodoc/iso/html/isodoc-dis.css +1 -1
- data/lib/isodoc/iso/html/isodoc-dis.scss +1 -1
- data/lib/isodoc/iso/html/isodoc.css +1 -1
- data/lib/isodoc/iso/html/isodoc.scss +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +506 -156
- data/lib/isodoc/iso/iso.international-standard.xsl +506 -156
- data/lib/isodoc/iso/presentation_bibdata.rb +0 -29
- data/lib/isodoc/iso/presentation_xml_convert.rb +95 -30
- data/lib/isodoc/iso/presentation_xref.rb +4 -2
- data/lib/isodoc/iso/sections.rb +2 -2
- data/lib/isodoc/iso/word_convert.rb +11 -13
- data/lib/isodoc/iso/word_dis_convert.rb +1 -4
- data/lib/isodoc/iso/xref.rb +52 -14
- data/lib/isodoc/iso/xref_section.rb +23 -28
- data/lib/metanorma/iso/biblio.rng +13 -1
- data/lib/metanorma/iso/isodoc.rng +6 -6
- data/lib/metanorma/iso/relaton-iso.rng +13 -30
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/metanorma/requirements/modspec.rb +10 -6
- data/metanorma-iso.gemspec +1 -1
- metadata +4 -4
@@ -4,35 +4,6 @@ module IsoDoc
|
|
4
4
|
def bibdata(docxml)
|
5
5
|
super
|
6
6
|
editorialgroup_identifier(docxml)
|
7
|
-
warning_for_missing_metadata(docxml)
|
8
|
-
end
|
9
|
-
|
10
|
-
def warning_for_missing_metadata(docxml)
|
11
|
-
@meta.get[:unpublished] or return
|
12
|
-
ret = warning_for_missing_metadata_create(docxml)
|
13
|
-
ret.empty? and return
|
14
|
-
warning_for_missing_metadata_post(docxml, ret)
|
15
|
-
end
|
16
|
-
|
17
|
-
def warning_for_missing_metadata_create(docxml)
|
18
|
-
ret = ""
|
19
|
-
docxml.at(ns("//bibdata/ext//secretariat")) or
|
20
|
-
ret += "<p>Secretariat is missing.</p>"
|
21
|
-
docxml.at(ns("//bibdata/ext//editorialgroup")) or
|
22
|
-
ret += "<p>Editorial groups are missing.</p>"
|
23
|
-
docxml.at(ns("//bibdata/date[@type = 'published' or @type = 'issued' " \
|
24
|
-
"or @type = 'created']")) ||
|
25
|
-
docxml.at(ns("//bibdata/version/revision-date")) or
|
26
|
-
ret += "<p>Document date is missing.</p>"
|
27
|
-
ret
|
28
|
-
end
|
29
|
-
|
30
|
-
def warning_for_missing_metadata_post(docxml, ret)
|
31
|
-
id = UUIDTools::UUID.random_create
|
32
|
-
ret = "<review date='#{Date.today}' reviewer='Metanorma' id='_#{id}'>" \
|
33
|
-
"<p><strong>Metadata warnings:<strong></p> #{ret}</review>"
|
34
|
-
ins = docxml.at(ns("//sections//title")) or return
|
35
|
-
ins.add_first_child ret
|
36
7
|
end
|
37
8
|
|
38
9
|
def editorialgroup_identifier(docxml)
|
@@ -23,6 +23,39 @@ module IsoDoc
|
|
23
23
|
super
|
24
24
|
end
|
25
25
|
|
26
|
+
def section(docxml)
|
27
|
+
super
|
28
|
+
warning_for_missing_metadata(docxml)
|
29
|
+
end
|
30
|
+
|
31
|
+
def warning_for_missing_metadata(docxml)
|
32
|
+
@meta.get[:unpublished] or return
|
33
|
+
ret = warning_for_missing_metadata_create(docxml)
|
34
|
+
ret.empty? and return
|
35
|
+
warning_for_missing_metadata_post(docxml, ret)
|
36
|
+
end
|
37
|
+
|
38
|
+
def warning_for_missing_metadata_create(docxml)
|
39
|
+
ret = ""
|
40
|
+
docxml.at(ns("//bibdata/ext//secretariat")) or
|
41
|
+
ret += "<p>Secretariat is missing.</p>"
|
42
|
+
docxml.at(ns("//bibdata/ext//editorialgroup")) or
|
43
|
+
ret += "<p>Editorial groups are missing.</p>"
|
44
|
+
docxml.at(ns("//bibdata/date[@type = 'published' or @type = 'issued' " \
|
45
|
+
"or @type = 'created']")) ||
|
46
|
+
docxml.at(ns("//bibdata/version/revision-date")) or
|
47
|
+
ret += "<p>Document date is missing.</p>"
|
48
|
+
ret
|
49
|
+
end
|
50
|
+
|
51
|
+
def warning_for_missing_metadata_post(docxml, ret)
|
52
|
+
id = UUIDTools::UUID.random_create
|
53
|
+
ret = "<review date='#{Date.today}' reviewer='Metanorma' id='_#{id}'>" \
|
54
|
+
"<p><strong>Metadata warnings:<strong></p> #{ret}</review>"
|
55
|
+
ins = docxml.at(ns("//sections//fmt-title")) or return
|
56
|
+
ins.add_first_child ret
|
57
|
+
end
|
58
|
+
|
26
59
|
def block(docxml)
|
27
60
|
amend docxml
|
28
61
|
figure docxml
|
@@ -30,6 +63,7 @@ module IsoDoc
|
|
30
63
|
formula docxml
|
31
64
|
admonition docxml
|
32
65
|
source docxml
|
66
|
+
ul docxml
|
33
67
|
ol docxml
|
34
68
|
quote docxml
|
35
69
|
permission docxml
|
@@ -38,6 +72,7 @@ module IsoDoc
|
|
38
72
|
requirement_render docxml
|
39
73
|
@xrefs.anchors_previous = @xrefs.anchors.dup # store old xrefs of reqts
|
40
74
|
@xrefs.parse docxml
|
75
|
+
# TODO move this dependency around: requirements at root should be processed before everything else
|
41
76
|
table docxml # have table include requirements newly converted to tables
|
42
77
|
# table feeds dl
|
43
78
|
dl docxml
|
@@ -45,30 +80,41 @@ module IsoDoc
|
|
45
80
|
note docxml
|
46
81
|
end
|
47
82
|
|
83
|
+
# Redo Amendment annex titles as numbered
|
48
84
|
def annex(isoxml)
|
49
85
|
amd?(isoxml) and @suppressheadingnumbers = @oldsuppressheadingnumbers
|
50
86
|
super
|
51
|
-
isoxml
|
87
|
+
amd?(isoxml) and @suppressheadingnumbers = true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Redo Amendment annex subclause titles as numbered
|
91
|
+
def clause(docxml)
|
92
|
+
super
|
93
|
+
docxml.xpath(ns("//annex//appendix")).each { |f| clause1(f) }
|
94
|
+
amd?(docxml) or return
|
95
|
+
@suppressheadingnumbers = @oldsuppressheadingnumbers
|
96
|
+
docxml.xpath(ns("//annex//clause | //annex//appendix")).each do |f|
|
97
|
+
f.xpath(ns("./fmt-title | ./fmt-xref-label")).each(&:remove)
|
52
98
|
clause1(f)
|
53
99
|
end
|
54
|
-
|
100
|
+
@suppressheadingnumbers = true
|
101
|
+
end
|
102
|
+
|
103
|
+
def subfigure_delim
|
104
|
+
"<span class='fmt-label-delim'>)</span>"
|
105
|
+
end
|
106
|
+
|
107
|
+
def figure_delim(elem)
|
108
|
+
elem.parent.name == "figure" ? "  " : " — "
|
55
109
|
end
|
56
110
|
|
57
|
-
def
|
58
|
-
|
59
|
-
|
60
|
-
lbl = @xrefs.anchor(node["id"], :label, false) or return
|
61
|
-
figname = node.parent.name == "figure" ? "" : "#{@i18n.figure} "
|
62
|
-
conn = node.parent.name == "figure" ? "  " : " — "
|
63
|
-
prefix_name(node, conn, l10n("#{figname}#{lbl}"), "name")
|
111
|
+
def figure_name(elem)
|
112
|
+
elem.parent.name == "figure" and return ""
|
113
|
+
super
|
64
114
|
end
|
65
115
|
|
66
|
-
def
|
67
|
-
|
68
|
-
lbl = if n.nil? || blank?(n[:label]) then @i18n.example
|
69
|
-
else l10n("#{@i18n.example} #{n[:label]}")
|
70
|
-
end
|
71
|
-
prefix_name(node, block_delim, lbl, "name")
|
116
|
+
def figure_label?(_elem)
|
117
|
+
true
|
72
118
|
end
|
73
119
|
|
74
120
|
def example_span_label(_node, div, name)
|
@@ -79,27 +125,34 @@ module IsoDoc
|
|
79
125
|
end
|
80
126
|
|
81
127
|
def clause1(node)
|
82
|
-
|
83
|
-
|
128
|
+
!node.at(ns("./title")) &&
|
129
|
+
!%w(sections preface bibliography).include?(node.parent.name) and
|
84
130
|
node["inline-header"] = "true"
|
85
|
-
end
|
86
131
|
super
|
87
|
-
|
88
|
-
t = node.at(ns("./title/tab")) and
|
89
|
-
t.previous = @i18n.l10n(": ").sub(/\p{Zs}$/, "")
|
90
|
-
end
|
132
|
+
clause1_section_prefix(node)
|
91
133
|
end
|
92
134
|
|
93
|
-
def
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
135
|
+
def clause1_section_prefix(node)
|
136
|
+
if node["type"] == "section" &&
|
137
|
+
c = node.at(ns("./fmt-title//span[@class = 'fmt-caption-delim']"))
|
138
|
+
c.add_first_child(":")
|
139
|
+
t = node.at(ns("./fmt-title"))
|
140
|
+
# French l10n needs tab to be treated as space
|
141
|
+
t.replace @i18n.l10n(to_xml(t).gsub("<tab/>", "<tab> </tab>"))
|
142
|
+
.gsub(%r{<tab>[^<]+</tab>}, "<tab/>")
|
100
143
|
end
|
101
144
|
end
|
102
145
|
|
146
|
+
# def clause(docxml)
|
147
|
+
# docxml.xpath(ns("//clause[not(ancestor::annex)] | " \
|
148
|
+
# "//terms | //definitions | //references | " \
|
149
|
+
# "//preface/introduction[clause]")).each do |f|
|
150
|
+
# f.parent.name == "annex" &&
|
151
|
+
# @xrefs.klass.single_term_clause?(f.parent) and next
|
152
|
+
# clause1(f)
|
153
|
+
# end
|
154
|
+
# end
|
155
|
+
|
103
156
|
def admonition1(elem)
|
104
157
|
super
|
105
158
|
admonition_outside_clauses(elem)
|
@@ -153,10 +206,22 @@ module IsoDoc
|
|
153
206
|
end
|
154
207
|
|
155
208
|
def table1(elem)
|
209
|
+
table1_key(elem)
|
210
|
+
if elem["class"] == "modspec"
|
211
|
+
n = elem.at(ns(".//fmt-name")).remove
|
212
|
+
n.name = "name"
|
213
|
+
elem.add_first_child(n)
|
214
|
+
elem.at(ns("./thead"))&.remove
|
215
|
+
super
|
216
|
+
elem.at(ns("./name")).remove
|
217
|
+
else super
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
def table1_key(elem)
|
156
222
|
elem.xpath(ns(".//dl[@key = 'true'][not(./name)]")).each do |dl|
|
157
223
|
dl.add_first_child "<name>#{@i18n.key}</name>"
|
158
224
|
end
|
159
|
-
super
|
160
225
|
end
|
161
226
|
|
162
227
|
def toc_title(docxml)
|
@@ -74,7 +74,7 @@ module IsoDoc
|
|
74
74
|
|
75
75
|
def locality_span_wrap(ret, type)
|
76
76
|
type or return ret
|
77
|
-
m =
|
77
|
+
m = /\A(\s*)(?=\S)(.+?)(\s*)\Z/m.match(ret) or return ret
|
78
78
|
ret = [m[1], m[2], m[3]]
|
79
79
|
spanclass = LOCALITY2SPAN[type.to_sym] and
|
80
80
|
ret[1] = "<span class='#{spanclass}'>#{ret[1]}</span>"
|
@@ -115,7 +115,9 @@ module IsoDoc
|
|
115
115
|
prefix_container_template(container, node, target)
|
116
116
|
container_label = prefix_container(container_container,
|
117
117
|
container_label, node, target)
|
118
|
-
l10n(nested_xref
|
118
|
+
l10n(connectives_spans(nested_xref
|
119
|
+
.sub("%1", "<span class='fmt-xref-container'>#{container_label}</span>")
|
120
|
+
.sub("%2", linkend)))
|
119
121
|
end
|
120
122
|
|
121
123
|
def prefix_container_template(container, node, target)
|
data/lib/isodoc/iso/sections.rb
CHANGED
@@ -12,9 +12,9 @@ module IsoDoc
|
|
12
12
|
@foreword = true
|
13
13
|
page_break(out)
|
14
14
|
out.div **attr_code(id: clause["id"]) do |s|
|
15
|
-
clause_name(nil, clause.at(ns("./title")), s,
|
15
|
+
clause_name(nil, clause.at(ns("./fmt-title")), s,
|
16
16
|
{ class: "ForewordTitle" })
|
17
|
-
clause.elements.each { |e| parse(e, s) unless e.name == "title" }
|
17
|
+
clause.elements.each { |e| parse(e, s) unless e.name == "fmt-title" }
|
18
18
|
end
|
19
19
|
@foreword = false
|
20
20
|
end
|
@@ -108,7 +108,7 @@ module IsoDoc
|
|
108
108
|
br(out, "auto")
|
109
109
|
out.div class: "index" do |div|
|
110
110
|
elem.children.each do |e|
|
111
|
-
parse(e, div) unless e.name == "title"
|
111
|
+
parse(e, div) unless e.name == "fmt-title"
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -116,7 +116,7 @@ module IsoDoc
|
|
116
116
|
def indexsect_title(clause, out)
|
117
117
|
br(out, "always")
|
118
118
|
out.div class: "WordSection3" do |div|
|
119
|
-
clause_name(clause, clause.at(ns("./title")), div, nil)
|
119
|
+
clause_name(clause, clause.at(ns("./fmt-title")), div, nil)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -145,7 +145,7 @@ module IsoDoc
|
|
145
145
|
page_break(out)
|
146
146
|
out.div do |div|
|
147
147
|
div.h1 **bibliography_attrs do |h1|
|
148
|
-
node&.at(ns("./title"))&.children&.each { |c2| parse(c2, h1) }
|
148
|
+
node&.at(ns("./fmt-title"))&.children&.each { |c2| parse(c2, h1) }
|
149
149
|
end
|
150
150
|
biblio_list(node, div, true)
|
151
151
|
end
|
@@ -154,7 +154,7 @@ module IsoDoc
|
|
154
154
|
def bibliography_parse(node, out)
|
155
155
|
node["hidden"] != true or return
|
156
156
|
out.div do |div|
|
157
|
-
clause_parse_title(node, div, node.at(ns("./title")), out,
|
157
|
+
clause_parse_title(node, div, node.at(ns("./fmt-title")), out,
|
158
158
|
bibliography_attrs)
|
159
159
|
biblio_list(node, div, true)
|
160
160
|
end
|
@@ -201,7 +201,7 @@ module IsoDoc
|
|
201
201
|
end
|
202
202
|
|
203
203
|
def table_title_parse(node, out)
|
204
|
-
name = node.at(ns("./name")) or return
|
204
|
+
name = node.at(ns("./fmt-name")) or return
|
205
205
|
out.p **table_title_attrs(node) do |p|
|
206
206
|
name&.children&.each { |n| parse(n, p) }
|
207
207
|
end
|
@@ -209,7 +209,7 @@ module IsoDoc
|
|
209
209
|
|
210
210
|
def annex_name(_annex, name, div)
|
211
211
|
name.nil? and return
|
212
|
-
name&.at(ns("
|
212
|
+
name&.at(ns(".//strong"))&.remove # label supplied by CSS list numbering
|
213
213
|
div.h1 class: "Annex" do |t|
|
214
214
|
annex_name1(name, t)
|
215
215
|
clause_parse_subtitle(name, t)
|
@@ -217,14 +217,12 @@ module IsoDoc
|
|
217
217
|
end
|
218
218
|
|
219
219
|
def annex_name1(name, out)
|
220
|
-
name.
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
end
|
225
|
-
else parse(c2, out)
|
226
|
-
end
|
220
|
+
n = name.dup
|
221
|
+
n.xpath(ns(".//span[@class = 'fmt-obligation']")).each do |s|
|
222
|
+
s.delete("class")
|
223
|
+
s["style"] = "font-weight:normal;"
|
227
224
|
end
|
225
|
+
children_parse(n, out)
|
228
226
|
end
|
229
227
|
|
230
228
|
def table_attrs(node)
|
@@ -111,10 +111,7 @@ module IsoDoc
|
|
111
111
|
out.span **attr_code(style: st) do |s|
|
112
112
|
node.children.each { |n| parse(n, s) }
|
113
113
|
end
|
114
|
-
else
|
115
|
-
out.span **attr_code(class: node["class"], style: st) do |x|
|
116
|
-
node.children.each { |n| parse(n, x) }
|
117
|
-
end
|
114
|
+
else super
|
118
115
|
end
|
119
116
|
end
|
120
117
|
|
data/lib/isodoc/iso/xref.rb
CHANGED
@@ -48,25 +48,56 @@ module IsoDoc
|
|
48
48
|
c = IsoDoc::XrefGen::Counter.new
|
49
49
|
clause.xpath(ns(".//formula")).noblank.each do |t|
|
50
50
|
@anchors[t["id"]] = anchor_struct(
|
51
|
-
"#{num}#{
|
51
|
+
#"#{num}#{hier_separator}#{c.increment(t).print}", t,
|
52
|
+
hiersemx(clause, num, c.increment(t), t), t,
|
52
53
|
t["inequality"] ? @labels["inequality"] : @labels["formula"],
|
53
|
-
"formula", t["unnumbered"]
|
54
|
+
"formula", { unnumb: t["unnumbered"], container: true }
|
54
55
|
)
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
59
|
+
def subfigure_delim
|
60
|
+
")"
|
61
|
+
end
|
62
|
+
|
58
63
|
def figure_anchor(elem, sublabel, label, klass, container: false)
|
64
|
+
if sublabel
|
65
|
+
subfigure_anchor(elem, sublabel, label, klass, container: container)
|
66
|
+
else
|
67
|
+
@anchors[elem["id"]] = anchor_struct(
|
68
|
+
label, elem, @labels[klass] || klass.capitalize, klass,
|
69
|
+
{ unnumb: elem["unnumbered"], container: }
|
70
|
+
)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def fig_subfig_label(label, sublabel)
|
75
|
+
"#{label} #{sublabel}"
|
76
|
+
end
|
77
|
+
|
78
|
+
def subfigure_anchor(elem, sublabel, label, klass, container: false)
|
79
|
+
figlabel = fig_subfig_label(label, sublabel)
|
59
80
|
@anchors[elem["id"]] = anchor_struct(
|
60
|
-
|
61
|
-
|
81
|
+
figlabel, elem, @labels[klass] || klass.capitalize, klass,
|
82
|
+
{ unnumb: elem["unnumbered"] }
|
62
83
|
)
|
63
|
-
|
84
|
+
if elem["unnumbered"] != "true"
|
85
|
+
# Dropping the parent figure label is specific to ISO
|
64
86
|
@anchors[elem["id"]][:label] = sublabel
|
87
|
+
@anchors[elem["id"]][:xref] = @anchors[elem.parent["id"]][:xref] +
|
88
|
+
" " + semx(elem, sublabel) + delim_wrap(subfigure_delim)
|
89
|
+
x = @anchors[elem.parent["id"]][:container] and
|
90
|
+
@anchors[elem["id"]][:container] = x
|
91
|
+
end
|
65
92
|
end
|
66
93
|
|
67
94
|
def subfigure_label(subfignum)
|
68
|
-
subfignum.zero? and return
|
69
|
-
|
95
|
+
subfignum.zero? and return
|
96
|
+
(subfignum + 96).chr
|
97
|
+
end
|
98
|
+
|
99
|
+
def hierfigsep
|
100
|
+
" "
|
70
101
|
end
|
71
102
|
|
72
103
|
def sequential_figure_names(clause, container: false)
|
@@ -97,9 +128,9 @@ module IsoDoc
|
|
97
128
|
j = 0
|
98
129
|
clause.xpath(ns(FIGURE_NO_CLASS)).noblank.each do |t|
|
99
130
|
j = subfigure_increment(j, c, t)
|
100
|
-
label = "#{num}#{
|
131
|
+
#label = "#{num}#{hier_separator}#{c.print}"
|
101
132
|
sublabel = subfigure_label(j)
|
102
|
-
figure_anchor(t, sublabel,
|
133
|
+
figure_anchor(t, sublabel, hiersemx(clause, num, c, t), "figure")
|
103
134
|
end
|
104
135
|
hierarchical_figure_class_names(clause, num)
|
105
136
|
end
|
@@ -111,9 +142,9 @@ module IsoDoc
|
|
111
142
|
.noblank.each do |t|
|
112
143
|
c[t["class"]] ||= IsoDoc::XrefGen::Counter.new
|
113
144
|
j = subfigure_increment(j, c[t["class"]], t)
|
114
|
-
label = "#{num}#{
|
145
|
+
#label = "#{num}#{hier_separator}#{c.print}"
|
115
146
|
sublabel = j.zero? ? nil : "#{(j + 96).chr})"
|
116
|
-
figure_anchor(t, sublabel,
|
147
|
+
figure_anchor(t, sublabel, hiersemx(clause, num, c[t["class"]], t), t["class"])
|
117
148
|
end
|
118
149
|
end
|
119
150
|
|
@@ -129,8 +160,10 @@ module IsoDoc
|
|
129
160
|
s.xpath(ns(".//appendix//ol")) - s.xpath(ns(".//ol//ol"))
|
130
161
|
c = Counter.new
|
131
162
|
notes.noblank.each do |n|
|
163
|
+
n["id"] ||= "_#{UUIDTools::UUID.random_create}"
|
132
164
|
@anchors[n["id"]] = anchor_struct(increment_label(notes, n, c), n,
|
133
|
-
@labels["list"], "list",
|
165
|
+
@labels["list"], "list",
|
166
|
+
{ unnumb: false, container: true })
|
134
167
|
list_item_anchor_names(n, @anchors[n["id"]], 1, "",
|
135
168
|
!single_ol_for_xrefs?(notes))
|
136
169
|
end
|
@@ -174,7 +207,11 @@ module IsoDoc
|
|
174
207
|
(@anchors[id] && !@anchors[id][:has_modspec]) or return
|
175
208
|
@anchors[id][:has_modspec] = true
|
176
209
|
x = @anchors_previous[id][:xref_bare] || @anchors_previous[id][:xref]
|
177
|
-
@anchors[id][:xref] = l10n("#{table_label}
|
210
|
+
# @anchors[id][:xref] = l10n("#{table_label}<span class='fmt-comma'>,</span> #{x}")
|
211
|
+
|
212
|
+
@anchors[id][:xref] = l10n(@klass.connectives_spans(@i18n.nested_xref
|
213
|
+
.sub("%1", table_label).sub("%2", x)))
|
214
|
+
|
178
215
|
@anchors[id][:modspec] = @anchors_previous[id][:modspec]
|
179
216
|
@anchors[id][:subtype] = "modspec" # prevents citetbl style from beign applied
|
180
217
|
true
|
@@ -194,7 +231,8 @@ module IsoDoc
|
|
194
231
|
countable.each do |n|
|
195
232
|
@anchors[n["id"]] =
|
196
233
|
anchor_struct(increment_label(countable, n, counter), n,
|
197
|
-
@labels["note_xref"], "note",
|
234
|
+
@labels["note_xref"], "note",
|
235
|
+
{ unnum: false, container: true })
|
198
236
|
end
|
199
237
|
end
|
200
238
|
end
|
@@ -7,9 +7,10 @@ module IsoDoc
|
|
7
7
|
clause.at(ns("./clause")) and
|
8
8
|
@anchors[clause["id"]] = { label: nil, level: 1, type: "clause",
|
9
9
|
xref: clause.at(ns("./title"))&.text }
|
10
|
-
i = Counter.new(0, prefix: "0")
|
10
|
+
#i = Counter.new(0, prefix: "0")
|
11
|
+
i = clause_counter(0)
|
11
12
|
clause.xpath(ns("./clause")).each do |c|
|
12
|
-
section_names1(c, i.increment(c).print, 2)
|
13
|
+
section_names1(c, semx(clause, "0"), i.increment(c).print, 2)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
@@ -19,17 +20,18 @@ module IsoDoc
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def appendix_names(clause, _num)
|
22
|
-
i =
|
23
|
+
i = clause_counter(0)
|
23
24
|
clause.xpath(ns("./appendix")).each do |c|
|
24
25
|
i.increment(c)
|
26
|
+
num = semx(c, i.print)
|
27
|
+
lbl = labelled_autonum(@labels["appendix"], num)
|
25
28
|
@anchors[c["id"]] =
|
26
|
-
anchor_struct(i.print,
|
29
|
+
anchor_struct(i.print, c, @labels["appendix"],
|
27
30
|
"clause").merge(level: 2, subtype: "annex",
|
28
31
|
container: clause["id"])
|
29
|
-
j =
|
32
|
+
j = clause_counter(0)
|
30
33
|
c.xpath(ns("./clause | ./references")).each do |c1|
|
31
|
-
lbl
|
32
|
-
appendix_names1(c1, l10n(lbl), 3, clause["id"])
|
34
|
+
appendix_names1(c1, lbl, j.increment(c1).print, 3, clause["id"])
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -38,48 +40,41 @@ module IsoDoc
|
|
38
40
|
# retaining subtype for the semantics
|
39
41
|
def section_name_anchors(clause, num, level)
|
40
42
|
if clause["type"] == "section"
|
43
|
+
xref = labelled_autonum(@labels["section"], num)
|
44
|
+
label = labelled_autonum(@labels["section"], num)
|
41
45
|
@anchors[clause["id"]] =
|
42
|
-
{ label:
|
43
|
-
|
44
|
-
title: clause_title(clause), level: level, type: "clause",
|
45
|
-
elem: @labels["section"] }
|
46
|
+
{ label:, xref:, elem: @labels["section"],
|
47
|
+
title: clause_title(clause), level: level, type: "clause" }
|
46
48
|
elsif level > 1
|
49
|
+
#num = semx(clause, num)
|
47
50
|
@anchors[clause["id"]] =
|
48
51
|
{ label: num, level: level, xref: num, subtype: "clause" }
|
49
52
|
else super end
|
50
53
|
end
|
51
54
|
|
52
55
|
def annex_name_anchors1(clause, num, level)
|
56
|
+
level == 1 and return annex_name_anchors(clause, num, level)
|
53
57
|
ret = { label: num, level: level, subtype: "annex" }
|
54
58
|
ret2 = if level == 2
|
55
|
-
|
59
|
+
xref = labelled_autonum(@labels["clause"], num)
|
60
|
+
{ xref:, # l10n("#{@labels['clause']} #{num}"),
|
56
61
|
elem: @labels["clause"] }
|
57
62
|
else
|
58
|
-
{ xref: num }
|
63
|
+
{ xref: semx(clause, num) }
|
59
64
|
end
|
60
65
|
@anchors[clause["id"]] = ret.merge(ret2)
|
61
66
|
end
|
62
67
|
|
63
|
-
def
|
64
|
-
|
65
|
-
|
66
|
-
clause.xpath(ns("./clause | ./references")).each do |c|
|
67
|
-
annex_names1(c, i.increment(c).print, level + 1)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def appendix_names1(clause, num, level, container)
|
68
|
+
def appendix_names1(clause, parentnum, num, level, container)
|
69
|
+
#num = labelled_autonum(@labels["appendix"], num)
|
70
|
+
num = clause_number_semx(parentnum, clause, num)
|
72
71
|
@anchors[clause["id"]] = { label: num, xref: num, level: level,
|
73
72
|
container: container }
|
74
|
-
i =
|
73
|
+
i = clause_counter(0)
|
75
74
|
clause.xpath(ns("./clause | ./references")).each do |c|
|
76
|
-
appendix_names1(c, i.increment(c).print, level + 1, container)
|
75
|
+
appendix_names1(c, num, i.increment(c).print, level + 1, container)
|
77
76
|
end
|
78
77
|
end
|
79
|
-
|
80
|
-
def annex_name_lbl(clause, num)
|
81
|
-
super.sub(%r{<br/>(.*)$}, "<br/><span class='obligation'>\\1</span>")
|
82
|
-
end
|
83
78
|
end
|
84
79
|
end
|
85
80
|
end
|
@@ -1783,9 +1783,21 @@ that the `number` given for the series applies to the second iteration of number
|
|
1783
1783
|
May be used to differentiate rendering of notes in bibliographies</a:documentation>
|
1784
1784
|
</attribute>
|
1785
1785
|
</optional>
|
1786
|
-
<ref name="
|
1786
|
+
<ref name="LocalizedStringAttributes">
|
1787
1787
|
<a:documentation>The content of the note</a:documentation>
|
1788
1788
|
</ref>
|
1789
|
+
<choice>
|
1790
|
+
<oneOrMore>
|
1791
|
+
<ref name="BasicBlockNoId">
|
1792
|
+
<a:documentation>Multiple blocks of content</a:documentation>
|
1793
|
+
</ref>
|
1794
|
+
</oneOrMore>
|
1795
|
+
<oneOrMore>
|
1796
|
+
<ref name="TextElement">
|
1797
|
+
<a:documentation>Single block of content</a:documentation>
|
1798
|
+
</ref>
|
1799
|
+
</oneOrMore>
|
1800
|
+
</choice>
|
1789
1801
|
</element>
|
1790
1802
|
</define>
|
1791
1803
|
<define name="bibabstract">
|
@@ -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">
|
@@ -326,7 +326,7 @@ normative or informative references, some split references into sections organiz
|
|
326
326
|
<a:documentation>Content of note</a:documentation>
|
327
327
|
<oneOrMore>
|
328
328
|
<choice>
|
329
|
-
<ref name="paragraph"/>
|
329
|
+
<ref name="paragraph-with-footnote"/>
|
330
330
|
<ref name="ul"/>
|
331
331
|
<ref name="ol"/>
|
332
332
|
<ref name="dl"/>
|
@@ -412,7 +412,7 @@ normative or informative references, some split references into sections organiz
|
|
412
412
|
<element name="note">
|
413
413
|
<ref name="OptionalId"/>
|
414
414
|
<oneOrMore>
|
415
|
-
<ref name="paragraph"/>
|
415
|
+
<ref name="paragraph-with-footnote"/>
|
416
416
|
</oneOrMore>
|
417
417
|
</element>
|
418
418
|
</define>
|
@@ -1977,7 +1977,7 @@ used in document amendments</a:documentation>
|
|
1977
1977
|
<oneOrMore>
|
1978
1978
|
<choice>
|
1979
1979
|
<a:documentation>Content of the verbal representation of the term</a:documentation>
|
1980
|
-
<ref name="paragraph"/>
|
1980
|
+
<ref name="paragraph-with-footnote"/>
|
1981
1981
|
<ref name="dl"/>
|
1982
1982
|
<ref name="ol"/>
|
1983
1983
|
<ref name="ul"/>
|
@@ -2015,7 +2015,7 @@ used in document amendments</a:documentation>
|
|
2015
2015
|
<oneOrMore>
|
2016
2016
|
<choice>
|
2017
2017
|
<a:documentation>Content of the term note</a:documentation>
|
2018
|
-
<ref name="paragraph"/>
|
2018
|
+
<ref name="paragraph-with-footnote"/>
|
2019
2019
|
<ref name="ul"/>
|
2020
2020
|
<ref name="ol"/>
|
2021
2021
|
<ref name="dl"/>
|
@@ -2037,7 +2037,7 @@ used in document amendments</a:documentation>
|
|
2037
2037
|
<ref name="dl"/>
|
2038
2038
|
<ref name="quote"/>
|
2039
2039
|
<ref name="sourcecode"/>
|
2040
|
-
<ref name="paragraph"/>
|
2040
|
+
<ref name="paragraph-with-footnote"/>
|
2041
2041
|
<ref name="figure"/>
|
2042
2042
|
</choice>
|
2043
2043
|
</oneOrMore>
|