metanorma-iso 2.8.9 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cddf2aa3ff6244b6b2c71735ff0d0fadf3c09781f175a911acdd329fb0a1d8a4
4
- data.tar.gz: c8349e9a17b898ec039710f1db1129f771e138fd3f2d1aabd10831fb37a88c31
3
+ metadata.gz: 6b7b6883da4ce6bbf015239527a21673238975a1793459c2dde2ea18ca65cf8d
4
+ data.tar.gz: 56c0603011e5c16b2fc05e226661b6cbf361bef6b7099a7f3a7e750df12c5da1
5
5
  SHA512:
6
- metadata.gz: 044e820c2a45d6e90e0d56edbf546ee3edf9413ae4430abbcd142f56d0b4b1e0f08245b3873565aa4700b9d18f12259f4583208483cbf0377e9d3a94b0724f19
7
- data.tar.gz: f14bfec47073d66be2b55a84c19be102c24797c4bbbc878bc41253d99f2f6bc6be9cd39a50f47ec341c5232f29f370dc158655974710feab7e1032de2139da34
6
+ metadata.gz: 6e2f189df9167a3dfca2749a356faec5d7d0ab5d19530fde0752caba459ae6b36f3a18ce184ba801de5085dd4f98efd84f7c6ed8997d020884b257183687d909
7
+ data.tar.gz: e83e5d3eecc9951236bc3c21c6d812bbaac0bce2f6a148edaf41bb55a7fefbaadc83c35d7988fe38b12d59e707cdba4188ff306e1ef079a552b7b7a6ddea379c
@@ -13,11 +13,6 @@ module IsoDoc
13
13
  super
14
14
  end
15
15
 
16
- def implicit_reference(bib)
17
- bib.at(ns("./docidentifier"))&.text == "IEV" and return true
18
- super
19
- end
20
-
21
16
  # terms not defined in standoc
22
17
  def error_parse(node, out)
23
18
  case node.name
@@ -34,35 +29,34 @@ module IsoDoc
34
29
  end
35
30
  end
36
31
 
32
+ def example_p_class
33
+ nil
34
+ end
35
+
37
36
  def example_p_parse(node, div)
38
- div.p do |p|
39
- example_span_label(node, p, node&.at(ns("./name"))&.remove)
40
- insert_tab(p, 1)
41
- node.first_element_child.children.each { |n| parse(n, p) }
37
+ name = node.at(ns("./fmt-name"))
38
+ para = node.at(ns("./p"))
39
+ div.p **attr_code(class: example_p_class) do |p|
40
+ name and p.span class: "example_label" do |s|
41
+ name.children.each { |n| parse(n, s) }
42
+ end
43
+ insert_tab(p, 1) # TODO to Presentation XML
44
+ children_parse(para, p)
42
45
  end
43
- node.element_children[1..-1].each { |n| parse(n, div) }
46
+ para.xpath("./following-sibling::*").each { |n| parse(n, div) }
44
47
  end
45
48
 
46
49
  def example_parse1(node, div)
47
50
  div.p do |p|
48
- example_span_label(node, p, node.at(ns("./name")))
51
+ example_span_label(node, p, node.at(ns("./fmt-name")))
49
52
  insert_tab(p, 1)
50
53
  end
51
- node.children.each { |n| parse(n, div) unless n.name == "name" }
52
- end
53
-
54
- def node_begins_with_para(node)
55
- node.elements.each do |e|
56
- e.name == "name" and next
57
- e.name == "p" and return true
58
- return false
59
- end
60
- false
54
+ node.children.each { |n| parse(n, div) unless n.name == "fmt-name" }
61
55
  end
62
56
 
63
57
  def example_parse(node, out)
64
58
  out.div id: node["id"], class: "example" do |div|
65
- if node_begins_with_para(node)
59
+ if starts_with_para?(node)
66
60
  example_p_parse(node, div)
67
61
  else
68
62
  example_parse1(node, div)
@@ -83,42 +77,19 @@ module IsoDoc
83
77
  end
84
78
  end
85
79
 
86
- def admonition_parse(node, out)
87
- type = node["type"]
88
- name = admonition_name(node, type)
89
- out.div id: node["id"], class: admonition_class(node) do |div|
90
- if node.first_element_child.name == "p"
91
- admonition_p_parse(node, div, name)
92
- else
93
- admonition_parse1(node, div, name)
94
- end
95
- end
96
- end
97
-
98
80
  def admonition_class(node)
99
81
  if node["type"] == "editorial" then "zzHelp"
100
82
  else super
101
83
  end
102
84
  end
103
85
 
104
- def admonition_parse1(node, div, name)
105
- div.p do |p|
106
- admonition_name_parse(node, p, name) if name
107
- end
108
- node.children.each { |n| parse(n, div) unless n.name == "name" }
86
+ def admonition_p_parse(node, div)
87
+ admonition_name_in_first_para(node, div)
109
88
  end
110
89
 
111
- def admonition_p_parse(node, div, name)
112
- div.p do |p|
113
- admonition_name_parse(node, p, name) if name
114
- node.first_element_child.children.each { |n| parse(n, p) }
115
- end
116
- node.element_children[1..-1].each { |n| parse(n, div) }
117
- end
118
-
119
- def admonition_name_parse(_node, div, name)
120
- name.children.each { |n| parse(n, div) }
121
- div << " &#x2014; "
90
+ # TODO: To Presentation XML
91
+ def admonition_name_para_delim(para)
92
+ para << " "
122
93
  end
123
94
 
124
95
  def figure_name_parse(_node, div, name)
@@ -143,9 +114,9 @@ module IsoDoc
143
114
  class: clause.name == "definitions" ? "Symbols" : nil,
144
115
  ) do |div|
145
116
  num = num + 1
146
- clause_name(clause, clause&.at(ns("./title")), div, nil)
117
+ clause_name(clause, clause&.at(ns("./fmt-title")), div, nil)
147
118
  clause.elements.each do |e|
148
- parse(e, div) unless %w{title source}.include? e.name
119
+ parse(e, div) unless %w{fmt-title source}.include? e.name
149
120
  end
150
121
  end
151
122
  end
@@ -154,12 +125,6 @@ module IsoDoc
154
125
  super.merge(start: node["start"]).compact
155
126
  end
156
127
 
157
- def render_identifier(ident)
158
- ret = super
159
- ret[:sdo] = std_docid_semantic(ret[:sdo])
160
- ret
161
- end
162
-
163
128
  def table_parse(node, out)
164
129
  @in_table = true
165
130
  table_title_parse(node, out)
@@ -183,11 +148,10 @@ module IsoDoc
183
148
  measurement_units(node, out)
184
149
  out.div **figure_attrs(node) do |div|
185
150
  node.children.each do |n|
186
- figure_key(out) if n.name == "dl"
187
151
  n.name == "note" && n["type"] == "units" and next
188
- parse(n, div) unless n.name == "name"
152
+ parse(n, div) unless n.name == "fmt-name"
189
153
  end
190
- figure_name_parse(node, div, node.at(ns("./name")))
154
+ figure_name_parse(node, div, node.at(ns("./fmt-name")))
191
155
  end
192
156
  end
193
157
 
@@ -214,6 +178,12 @@ module IsoDoc
214
178
  super
215
179
  update_i18n(docxml)
216
180
  end
181
+
182
+ def span_parse(node, out)
183
+ node["class"] == "fmt-obligation" and
184
+ node["class"] = "obligation"
185
+ super
186
+ end
217
187
  end
218
188
  end
219
189
  end
@@ -4489,6 +4489,6 @@ div.Note table.dl {
4489
4489
  font-size: {{smallerfontsize}};
4490
4490
  margin-left: 1.0cm; }
4491
4491
 
4492
- td.example_label, td.note_label {
4492
+ td.example_label, td.note_label, td.termnote_label {
4493
4493
  font-size: {{smallerfontsize}};
4494
4494
  font-family: {{bodyfont}}; }
@@ -4314,7 +4314,7 @@ div.Note table.dl {
4314
4314
  margin-left: 1.0cm;
4315
4315
  }
4316
4316
 
4317
- td.example_label, td.note_label
4317
+ td.example_label, td.note_label, td.termnote_label
4318
4318
  {
4319
4319
  font-size: $smallerfontsize;
4320
4320
  font-family:$bodyfont;
@@ -1341,6 +1341,6 @@ div.Note table.dl {
1341
1341
  font-size: {{smallerfontsize}};
1342
1342
  margin-left: 1.0cm; }
1343
1343
 
1344
- span.note_label, span.example_label, td.example_label, td.note_label {
1344
+ span.note_label, span.example_label, td.example_label, td.note_label, span.termnote_label, td.termnote_label {
1345
1345
  font-size: {{smallerfontsize}};
1346
1346
  font-family: {{bodyfont}}; }
@@ -1307,7 +1307,7 @@ div.Note table.dl {
1307
1307
  margin-left: 1.0cm;
1308
1308
  }
1309
1309
 
1310
- span.note_label, span.example_label, td.example_label, td.note_label
1310
+ span.note_label, span.example_label, td.example_label, td.note_label, span.termnote_label, td.termnote_label
1311
1311
  {
1312
1312
  font-size: $smallerfontsize;
1313
1313
  font-family:$bodyfont;