metanorma-iso 2.2.4 → 2.3.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: 9a0563d9fa5bd34ed390701df2a0fc01e009d510059ddbfc859e6fa72505297b
4
- data.tar.gz: 0be48505ccf77b173cce715b7934f13eb169fdb5bdff34c136db5ea5992c1b28
3
+ metadata.gz: d83fb927cb8bc71790dd2b644f00ef5e55605fc0a4c12865b406f3107c29e365
4
+ data.tar.gz: 19ee55451fd8f24e839fd23a0aea32d0927fb20ebccaa75b045f82113eac3b57
5
5
  SHA512:
6
- metadata.gz: 047442e860fd1d6e8f067882db28c6724cd8d3b8b405a3227fef5213fe3aaa8602775418d439a93d5a29a3fc3a0ea7c628eb57ceae02ebe234b52494a75b35b3
7
- data.tar.gz: 867aa6a944da537296b117daa82e5622972b5609e03a90fde3aa32741de953f71b1ab063fd1a8ab70a466cf9abe03fffdd633b81c7ddedbd67760da5ba34f0b3
6
+ metadata.gz: 86e861221a56a29ab07d1d47516fb39d13626f2c6cb844783c2030b38a5be4f3f04a4a1ca6d55855eb9f1fc2dc4f772b10f089bd96ae91b741b85f865d4bdba9
7
+ data.tar.gz: b987964c53cee70a3fa4fffa4487fa9e89e3e1bc4d3358928f661c72dd59f462d0148a1a45ef401fa4bad29b8141b55fe38c1f0589685c0699e4f1eedcec9fc9
data/.gitignore CHANGED
@@ -12,7 +12,6 @@ spec/examples/rice_files/
12
12
 
13
13
  .rubocop-https--*
14
14
 
15
- /Gemfile.devel
16
15
  /Gemfile.lock
17
16
  /spec/assets/iso.doc
18
17
  /spec/assets/iso.html
@@ -88,9 +88,9 @@ module IsoDoc
88
88
 
89
89
  def formula_where(dlist, out)
90
90
  return if dlist.nil?
91
- return super unless dlist&.xpath(ns("./dt"))&.size == 1 &&
92
- dlist&.at(ns("./dd"))&.elements&.size == 1 &&
93
- dlist&.at(ns("./dd/p"))
91
+ return super unless dlist.xpath(ns("./dt"))&.size == 1 &&
92
+ dlist.at(ns("./dd"))&.elements&.size == 1 &&
93
+ dlist.at(ns("./dd/p"))
94
94
 
95
95
  out.span **{ class: "zzMoveToFollowing" } do |s|
96
96
  s << "#{@i18n.where} "
@@ -187,6 +187,12 @@ module IsoDoc
187
187
  def ol_attrs(node)
188
188
  super.merge(start: node["start"]).compact
189
189
  end
190
+
191
+ def render_identifier(ident)
192
+ ret = super
193
+ ret[:sdo] = std_docid_semantic(ret[:sdo])
194
+ ret
195
+ end
190
196
  end
191
197
  end
192
198
  end
@@ -220,7 +220,7 @@ p.AnnexTableTitle, li.AnnexTableTitle, div.AnnexTableTitle {
220
220
  text-align: center;
221
221
  text-indent: 0cm;
222
222
  line-height: 12.0pt;
223
- page-break-before: always;
223
+ /*page-break-before:always;*/
224
224
  mso-pagination: widow-orphan;
225
225
  page-break-after: avoid;
226
226
  /* mso-list:l4 level1 lfo15; */
@@ -246,7 +246,7 @@ p.AnnexTableTitleCxSpFirst, li.AnnexTableTitleCxSpFirst, div.AnnexTableTitleCxSp
246
246
  text-align: center;
247
247
  text-indent: 0cm;
248
248
  line-height: 12.0pt;
249
- page-break-before: always;
249
+ /*page-break-before:always;*/
250
250
  mso-pagination: widow-orphan;
251
251
  page-break-after: avoid;
252
252
  /* mso-list:l4 level1 lfo15; */
@@ -272,7 +272,7 @@ p.AnnexTableTitleCxSpMiddle, li.AnnexTableTitleCxSpMiddle, div.AnnexTableTitleCx
272
272
  text-align: center;
273
273
  text-indent: 0cm;
274
274
  line-height: 12.0pt;
275
- page-break-before: always;
275
+ /*page-break-before:always;*/
276
276
  mso-pagination: widow-orphan;
277
277
  page-break-after: avoid;
278
278
  /* mso-list:l4 level1 lfo15; */
@@ -301,7 +301,7 @@ p.AnnexTableTitleCxSpLast, li.AnnexTableTitleCxSpLast, div.AnnexTableTitleCxSpLa
301
301
  text-align: center;
302
302
  text-indent: 0cm;
303
303
  line-height: 12.0pt;
304
- page-break-before: always;
304
+ /*page-break-before:always;*/
305
305
  mso-pagination: widow-orphan;
306
306
  page-break-after: avoid;
307
307
  /* mso-list:l4 level1 lfo15; */
@@ -209,7 +209,7 @@ p.AnnexTableTitle, li.AnnexTableTitle, div.AnnexTableTitle
209
209
  text-align:center;
210
210
  text-indent:0cm;
211
211
  line-height:12.0pt;
212
- page-break-before:always;
212
+ /*page-break-before:always;*/
213
213
  mso-pagination:widow-orphan;
214
214
  page-break-after:avoid;
215
215
  /* mso-list:l4 level1 lfo15; */
@@ -234,7 +234,7 @@ p.AnnexTableTitleCxSpFirst, li.AnnexTableTitleCxSpFirst, div.AnnexTableTitleCxSp
234
234
  text-align:center;
235
235
  text-indent:0cm;
236
236
  line-height:12.0pt;
237
- page-break-before:always;
237
+ /*page-break-before:always;*/
238
238
  mso-pagination:widow-orphan;
239
239
  page-break-after:avoid;
240
240
  /* mso-list:l4 level1 lfo15; */
@@ -259,7 +259,7 @@ p.AnnexTableTitleCxSpMiddle, li.AnnexTableTitleCxSpMiddle, div.AnnexTableTitleCx
259
259
  text-align:center;
260
260
  text-indent:0cm;
261
261
  line-height:12.0pt;
262
- page-break-before:always;
262
+ /*page-break-before:always;*/
263
263
  mso-pagination:widow-orphan;
264
264
  page-break-after:avoid;
265
265
  /* mso-list:l4 level1 lfo15; */
@@ -287,7 +287,7 @@ p.AnnexTableTitleCxSpLast, li.AnnexTableTitleCxSpLast, div.AnnexTableTitleCxSpLa
287
287
  text-align:center;
288
288
  text-indent:0cm;
289
289
  line-height:12.0pt;
290
- page-break-before:always;
290
+ /*page-break-before:always;*/
291
291
  mso-pagination:widow-orphan;
292
292
  page-break-after:avoid;
293
293
  /* mso-list:l4 level1 lfo15; */
@@ -217,7 +217,7 @@ p.AnnexTableTitle, li.AnnexTableTitle, div.AnnexTableTitle {
217
217
  text-align: center;
218
218
  text-indent: 0cm;
219
219
  line-height: 12.0pt;
220
- page-break-before: always;
220
+ /*page-break-before:always;*/
221
221
  mso-pagination: widow-orphan;
222
222
  page-break-after: avoid;
223
223
  /* mso-list:l4 level1 lfo15; */
@@ -243,7 +243,7 @@ p.AnnexTableTitleCxSpFirst, li.AnnexTableTitleCxSpFirst, div.AnnexTableTitleCxSp
243
243
  text-align: center;
244
244
  text-indent: 0cm;
245
245
  line-height: 12.0pt;
246
- page-break-before: always;
246
+ /*page-break-before:always;*/
247
247
  mso-pagination: widow-orphan;
248
248
  page-break-after: avoid;
249
249
  /* mso-list:l4 level1 lfo15; */
@@ -269,7 +269,7 @@ p.AnnexTableTitleCxSpMiddle, li.AnnexTableTitleCxSpMiddle, div.AnnexTableTitleCx
269
269
  text-align: center;
270
270
  text-indent: 0cm;
271
271
  line-height: 12.0pt;
272
- page-break-before: always;
272
+ /*page-break-before:always;*/
273
273
  mso-pagination: widow-orphan;
274
274
  page-break-after: avoid;
275
275
  /* mso-list:l4 level1 lfo15; */
@@ -298,7 +298,7 @@ p.AnnexTableTitleCxSpLast, li.AnnexTableTitleCxSpLast, div.AnnexTableTitleCxSpLa
298
298
  text-align: center;
299
299
  text-indent: 0cm;
300
300
  line-height: 12.0pt;
301
- page-break-before: always;
301
+ /*page-break-before:always;*/
302
302
  mso-pagination: widow-orphan;
303
303
  page-break-after: avoid;
304
304
  /* mso-list:l4 level1 lfo15; */
@@ -207,7 +207,7 @@ p.AnnexTableTitle, li.AnnexTableTitle, div.AnnexTableTitle
207
207
  text-align:center;
208
208
  text-indent:0cm;
209
209
  line-height:12.0pt;
210
- page-break-before:always;
210
+ /*page-break-before:always;*/
211
211
  mso-pagination:widow-orphan;
212
212
  page-break-after:avoid;
213
213
  /* mso-list:l4 level1 lfo15; */
@@ -232,7 +232,7 @@ p.AnnexTableTitleCxSpFirst, li.AnnexTableTitleCxSpFirst, div.AnnexTableTitleCxSp
232
232
  text-align:center;
233
233
  text-indent:0cm;
234
234
  line-height:12.0pt;
235
- page-break-before:always;
235
+ /*page-break-before:always;*/
236
236
  mso-pagination:widow-orphan;
237
237
  page-break-after:avoid;
238
238
  /* mso-list:l4 level1 lfo15; */
@@ -257,7 +257,7 @@ p.AnnexTableTitleCxSpMiddle, li.AnnexTableTitleCxSpMiddle, div.AnnexTableTitleCx
257
257
  text-align:center;
258
258
  text-indent:0cm;
259
259
  line-height:12.0pt;
260
- page-break-before:always;
260
+ /*page-break-before:always;*/
261
261
  mso-pagination:widow-orphan;
262
262
  page-break-after:avoid;
263
263
  /* mso-list:l4 level1 lfo15; */
@@ -285,7 +285,7 @@ p.AnnexTableTitleCxSpLast, li.AnnexTableTitleCxSpLast, div.AnnexTableTitleCxSpLa
285
285
  text-align:center;
286
286
  text-indent:0cm;
287
287
  line-height:12.0pt;
288
- page-break-before:always;
288
+ /*page-break-before:always;*/
289
289
  mso-pagination:widow-orphan;
290
290
  page-break-after:avoid;
291
291
  /* mso-list:l4 level1 lfo15; */
@@ -58,7 +58,7 @@ module IsoDoc
58
58
  end
59
59
 
60
60
  def html_toc_entry(level, header)
61
- content = header.at("./following-sibling::p"\
61
+ content = header.at("./following-sibling::p" \
62
62
  "[@class = 'variant-title-toc']") || header
63
63
  if level == "h1" &&
64
64
  header.parent.at(".//h2#{toc_exclude_class}")
@@ -127,7 +127,7 @@ module IsoDoc
127
127
  terms.each_with_object(val) do |t, v|
128
128
  term, term2, term3 = extract_indexterms_init(t)
129
129
  term_hash_init(v, term, term2, term3, label)
130
- v[term][term2][term3][label] << t&.at(ns("./target"))&.children&.to_xml
130
+ v[term][term2][term3][label] << to_xml(t.at(ns("./target"))&.children)
131
131
  t.remove
132
132
  end
133
133
  end
@@ -154,7 +154,7 @@ module IsoDoc
154
154
 
155
155
  def extract_indexterms_init(term)
156
156
  %w(primary secondary tertiary).each_with_object([]) do |x, m|
157
- m << term&.at(ns("./#{x}"))&.children&.to_xml
157
+ m << to_xml(term.at(ns("./#{x}"))&.children)
158
158
  end
159
159
  end
160
160
 
@@ -34,9 +34,20 @@ module IsoDoc
34
34
  end
35
35
 
36
36
  def std_docid_semantic(id)
37
- return nil if id.nil?
37
+ id.nil? and return nil
38
+ ret = Nokogiri::XML.fragment(id)
39
+ ret.traverse do |x|
40
+ x.text? or next
41
+ x.replace(std_docid_semantic1(x.text))
42
+ end
43
+ to_xml(ret)
44
+ end
38
45
 
46
+ def std_docid_semantic1(id)
39
47
  ids = id.split(/ /)
48
+ %w(ISO IEC ITU IETF NIST OGC IEEE BIPM BSI IANA UN W3C IEV)
49
+ .include?(ids[0].sub(/\/.*$/, "")) or
50
+ return id
40
51
  ids.map! do |i|
41
52
  if %w(GUIDE TR TS DIR).include?(i)
42
53
  "<span class='stddocNumber'>#{i}</span>"