metanorma-generic 2.2.5 → 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: fbce166fafcaf89a0035517529d34b5c5e4d8788cbcdf49d2c1f504732caf42f
4
- data.tar.gz: 832bb3bfdb95e608d0c7b0e64f1b536803ec278a5bd9aded93a4b7eb0ae0aeec
3
+ metadata.gz: c4f4ab3c878c5e271d13ea0b54fb8b767d43727cb1c6d5d2001713fcee1a6060
4
+ data.tar.gz: 73f97affc1f31b62ea13d7b07d27af03992edb4345cad6fa450ce63819beedfd
5
5
  SHA512:
6
- metadata.gz: 5412b613208a44150f8555ef094d8514effe93870fcf8554c5ed4187f984094437dae20390fbeb86b07252897944aa6184c196b71d4abe4f951795c5c3e70c97
7
- data.tar.gz: 32b9857423366b31fb11a3052f3f0ba5a9765f6d81487498ba87df30068be81810cf322aeb4bc6dd15326e912ebcf799f05281620c558277bb1f33ac45634ba7
6
+ metadata.gz: 5a3da7cb82b0a039eb7826652cf8d398b4d2cfbf74af64c9fca2daea1ade6d1aebfb8c403004fde734b3050b049c246fb1bfb8100680f85598d18c0abe2c7f2a
7
+ data.tar.gz: 59a1922fea21ca1d1167b1648beecdba198e210fca8232389201af9c4e8a16d75f00ccb4015a2492c08e3d4ce34138e8a108d18306cc0006295424d8e3b4e772
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .rubocop-https--*
4
4
 
5
5
  /.rspec_status
6
- /Gemfile.devel
7
6
  /Gemfile.lock
8
7
  /coverage/
9
8
  /test.doc
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
15
15
  d["id"] = h2["id"]
16
16
  d.children.first.previous =
17
- "<strong>#{h2.remove.children.to_xml}</strong>&#xa0;"
17
+ "<strong>#{to_xml(h2.remove.children)}</strong>&#xa0;"
18
18
  end
19
19
  docxml
20
20
  end
@@ -82,6 +82,12 @@ div.figure {
82
82
  @include figureBlock();
83
83
  }
84
84
 
85
+ table div.figure {
86
+ padding: 0;
87
+ margin: 0;
88
+ }
89
+
90
+
85
91
  /*
86
92
  Document types + stages
87
93
  */
@@ -8,7 +8,7 @@ module IsoDoc
8
8
  def annex1(elem)
9
9
  lbl = @xrefs.anchor(elem["id"], :label)
10
10
  if t = elem.at(ns("./title"))
11
- t.children = "<strong>#{t.children.to_xml}</strong>"
11
+ t.children = "<strong>#{to_xml(t.children)}</strong>"
12
12
  end
13
13
  prefix_name(elem, "<br/>", lbl, "title")
14
14
  end
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
@@ -683,6 +682,9 @@
683
682
  </define>
684
683
  <define name="underline">
685
684
  <element name="underline">
685
+ <optional>
686
+ <attribute name="style"/>
687
+ </optional>
686
688
  <zeroOrMore>
687
689
  <ref name="PureTextElement"/>
688
690
  </zeroOrMore>
@@ -47,7 +47,7 @@
47
47
  </element>
48
48
  </define>
49
49
  <define name="DocumentType">
50
- <value>document</value>
50
+ <text/>
51
51
  </define>
52
52
  <define name="docsubtype">
53
53
  <element name="subdoctype">
@@ -216,6 +216,9 @@
216
216
  <optional>
217
217
  <ref name="fullname"/>
218
218
  </optional>
219
+ <zeroOrMore>
220
+ <ref name="credential"/>
221
+ </zeroOrMore>
219
222
  <zeroOrMore>
220
223
  <ref name="affiliation"/>
221
224
  </zeroOrMore>
@@ -232,6 +235,11 @@
232
235
  <ref name="FullNameType"/>
233
236
  </element>
234
237
  </define>
238
+ <define name="credential">
239
+ <element name="credential">
240
+ <text/>
241
+ </element>
242
+ </define>
235
243
  <define name="FullNameType">
236
244
  <choice>
237
245
  <group>
@@ -305,7 +313,9 @@
305
313
  <zeroOrMore>
306
314
  <ref name="affiliationdescription"/>
307
315
  </zeroOrMore>
308
- <ref name="organization"/>
316
+ <optional>
317
+ <ref name="organization"/>
318
+ </optional>
309
319
  </element>
310
320
  </define>
311
321
  <define name="affiliationname">
@@ -1316,7 +1326,7 @@
1316
1326
  <value>commentaryOf</value>
1317
1327
  <value>hasCommentary</value>
1318
1328
  <value>related</value>
1319
- <value>complements</value>
1329
+ <value>hasComplement</value>
1320
1330
  <value>complementOf</value>
1321
1331
  <value>obsoletes</value>
1322
1332
  <value>obsoletedBy</value>
@@ -32,6 +32,7 @@ module Metanorma
32
32
  template = configuration.docid_template ||
33
33
  "{{ organization_name_short }} {{ docnumeric }}"
34
34
  docid = xmldoc.at("//bibdata/docidentifier")
35
+ docid&.text&.empty? or return
35
36
  id = boilerplate_isodoc(xmldoc).populate_template(template, nil)
36
37
  (id.empty? and docid.remove) or docid.children = id
37
38
  end
@@ -9,7 +9,7 @@ module Metanorma
9
9
  if !configuration.organization_name_long.empty? &&
10
10
  !configuration.organization_name_short.empty? &&
11
11
  configuration.organization_name_long !=
12
- configuration.organization_name_short
12
+ configuration.organization_name_short
13
13
  { configuration.organization_name_long =>
14
14
  configuration.organization_name_short }
15
15
  else
@@ -23,13 +23,14 @@ module Metanorma
23
23
 
24
24
  def metadata_committee(node, xml)
25
25
  return unless node.attr("committee")
26
+
26
27
  xml.editorialgroup do |a|
27
28
  a.committee node.attr("committee"),
28
- **attr_code(type: node.attr("committee-type"))
29
+ **attr_code(type: node.attr("committee-type"))
29
30
  i = 2
30
- while node.attr("committee_#{i}") do
31
+ while node.attr("committee_#{i}")
31
32
  a.committee node.attr("committee_#{i}"),
32
- **attr_code(type: node.attr("committee-type_#{i}"))
33
+ **attr_code(type: node.attr("committee-type_#{i}"))
33
34
  i += 1
34
35
  end
35
36
  end
@@ -38,16 +39,16 @@ module Metanorma
38
39
  def metadata_status(node, xml)
39
40
  xml.status do |s|
40
41
  s.stage ( node.attr("status") || node.attr("docstage") ||
41
- configuration.default_stage || "published" )
42
+ configuration.default_stage || "published")
42
43
  x = node.attr("substage") and s.substage x
43
44
  x = node.attr("iteration") and s.iteration x
44
45
  end
45
46
  end
46
47
 
47
48
  def metadata_id(node, xml)
48
- xml.docidentifier **{ type:
49
- configuration.organization_name_short } do |i|
50
- i << "DUMMY"
49
+ xml.docidentifier type:
50
+ configuration.organization_name_short do |i|
51
+ i << (node.attr("docidentifier") || "")
51
52
  end
52
53
  xml.docnumber { |i| i << node.attr("docnumber") }
53
54
  end
@@ -72,8 +73,9 @@ module Metanorma
72
73
 
73
74
  def metadata_ext_hash(node, ext, hash)
74
75
  hash.each do |k, v|
75
- next if EXT_STRUCT.include?(k) || !v&.is_a?(Hash) && !node.attr(k)
76
- if v&.is_a?(Hash) && v["_list"]
76
+ next if EXT_STRUCT.include?(k) || (!v.is_a?(Hash) && !node.attr(k))
77
+
78
+ if v.is_a?(Hash) && v["_list"]
77
79
  csv_split(node.attr(k), ",").each do |val|
78
80
  metadata_ext_hash1(k, val, ext, v, node)
79
81
  end
@@ -84,21 +86,25 @@ module Metanorma
84
86
  end
85
87
 
86
88
  def metadata_ext_hash1(key, value, ext, hash, node)
87
- return if hash&.is_a?(Hash) && hash["_attribute"]
88
- is_hash = hash&.is_a?(Hash) &&
89
- !hash.keys.reject { |n| EXT_STRUCT.include?(n) }.empty?
89
+ return if hash.is_a?(Hash) && hash["_attribute"]
90
+
91
+ is_hash = hash.is_a?(Hash) &&
92
+ !hash.keys.reject { |n| EXT_STRUCT.include?(n) }.empty?
90
93
  return if !is_hash && (value.nil? || value.empty?)
91
- name = hash&.is_a?(Hash) ? (hash["_output"] || key) : key
94
+
95
+ name = hash.is_a?(Hash) ? (hash["_output"] || key) : key
92
96
  ext.send name, **attr_code(metadata_ext_attrs(hash, node)) do |e|
93
- is_hash ? metadata_ext_hash(node, e, hash) : (e << value)
97
+ is_hash ? metadata_ext_hash(node, e, hash) : (e << value)
94
98
  end
95
99
  end
96
100
 
97
101
  def metadata_ext_attrs(hash, node)
98
102
  return {} unless hash.is_a?(Hash)
103
+
99
104
  ret = {}
100
105
  hash.each do |k, v|
101
106
  next unless v.is_a?(Hash) && v["_attribute"]
107
+
102
108
  ret[(v["_output"] || k).to_sym] = node.attr(k)
103
109
  end
104
110
  ret
@@ -66,6 +66,7 @@
66
66
  <value>caution</value>
67
67
  <value>statement</value>
68
68
  <value>editorial</value>
69
+ <value>box</value>
69
70
  </choice>
70
71
  </define>
71
72
  <define name="index">
@@ -571,6 +572,11 @@
571
572
  <ref name="MultilingualRenderingType"/>
572
573
  </attribute>
573
574
  </optional>
575
+ <optional>
576
+ <attribute name="linenums">
577
+ <data type="boolean"/>
578
+ </attribute>
579
+ </optional>
574
580
  <optional>
575
581
  <ref name="tname"/>
576
582
  </optional>
@@ -1238,6 +1244,11 @@
1238
1244
  </define>
1239
1245
  <define name="concept">
1240
1246
  <element name="concept">
1247
+ <optional>
1248
+ <attribute name="bold">
1249
+ <data type="boolean"/>
1250
+ </attribute>
1251
+ </optional>
1241
1252
  <optional>
1242
1253
  <attribute name="ital">
1243
1254
  <data type="boolean"/>
@@ -1567,10 +1578,13 @@
1567
1578
  <zeroOrMore>
1568
1579
  <ref name="indexsect"/>
1569
1580
  </zeroOrMore>
1581
+ <optional>
1582
+ <ref name="colophon"/>
1583
+ </optional>
1570
1584
  </element>
1571
1585
  </define>
1572
1586
  <define name="misccontainer">
1573
- <element name="misc-container">
1587
+ <element name="metanorma-extension">
1574
1588
  <oneOrMore>
1575
1589
  <ref name="AnyElement"/>
1576
1590
  </oneOrMore>
@@ -1589,6 +1603,13 @@
1589
1603
  </oneOrMore>
1590
1604
  </element>
1591
1605
  </define>
1606
+ <define name="colophon">
1607
+ <element name="colophon">
1608
+ <oneOrMore>
1609
+ <ref name="content"/>
1610
+ </oneOrMore>
1611
+ </element>
1612
+ </define>
1592
1613
  <define name="foreword">
1593
1614
  <element name="foreword">
1594
1615
  <ref name="Content-Section"/>
@@ -2653,6 +2674,7 @@
2653
2674
  <value>full</value>
2654
2675
  <value>short</value>
2655
2676
  <value>id</value>
2677
+ <text/>
2656
2678
  </choice>
2657
2679
  </define>
2658
2680
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "2.2.5".freeze
3
+ VERSION = "2.3.1".freeze
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
30
  spec.add_dependency "htmlentities", "~> 4.3.4"
31
- spec.add_dependency "metanorma-standoc", "~> 2.2.4"
31
+ spec.add_dependency "metanorma-standoc", "~> 2.3.0"
32
32
  spec.add_dependency "ruby-jing"
33
33
 
34
34
  spec.add_development_dependency "debug"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.3.1
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-15 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.4
33
+ version: 2.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.2.4
40
+ version: 2.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-jing
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  - !ruby/object:Gem::Version
269
269
  version: '0'
270
270
  requirements: []
271
- rubygems_version: 3.3.7
271
+ rubygems_version: 3.3.26
272
272
  signing_key:
273
273
  specification_version: 4
274
274
  summary: Metanorma template gem for customisation.