metanorma-ietf 3.1.4 → 3.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77f374d41d27e5ae1c4180f322ac2bba54ff71bc94676c138f01441349155904
4
- data.tar.gz: 4e1ce912a2612cc577c26eebeaf38baca2fb9bd128fce58ce94b0ce61bbf4691
3
+ metadata.gz: b1de8bb90257472a5f374f7fd19856322e1f69e0510eedafde925e2f935883f8
4
+ data.tar.gz: d6b838f193f84b6c78df8ccad0e4d15f2ba46f1cd81a58d05751287561a96bfd
5
5
  SHA512:
6
- metadata.gz: a1be7b947dd7e087e48721cea713fa11238809ebf64daa1e7442a12215b60e444a7d0e1ff5a387f2ddee50246d737b3f7359100f34a7dcae45e2632f2824ceaa
7
- data.tar.gz: ad196ce8dabad6753c5d31cc022ea3c864b656a184d6fc6e46cd8482326714082833e8d8455636e9172cbf593945931c4e02ede4dfe1fd6a6909f9775c098cf7
6
+ metadata.gz: d75bd0f7b1c507efaae0514a050fa41ab81b14e4cd10677dbeed3f194a609c325a12931ff015c1bcac305a921c9d798d4153ebb87ff5db4ba321d04db32b7d64
7
+ data.tar.gz: dd62ea88a5a93d0b22f189ed4c9268b9d9bfcae0d2fa3b8c59d2e41fdab7d5d8a3e6eabe48b0fa454ce927c6e85947eca3b0bae9534a3e52e5f043fc1bc3d758
@@ -87,8 +87,8 @@ module IsoDoc
87
87
  p << note_label(node)
88
88
  first.name == "p" and first.children.each { |n| parse(n, p) }
89
89
  end
90
- first.name == "p" and
91
- node.elements.drop(1).each { |n| parse(n, out) } or
90
+ (first.name == "p" and
91
+ node.elements.drop(1).each { |n| parse(n, out) }) or
92
92
  node.children.each { |n| parse(n, out) }
93
93
  end
94
94
  end
@@ -112,13 +112,21 @@ module IsoDoc
112
112
  end
113
113
  end
114
114
 
115
+ def source_parse(node, out)
116
+ termref_parse(node, out)
117
+ end
118
+
115
119
  def sourcecode_parse(node, out)
116
120
  out.sourcecode **attr_code(
117
121
  anchor: node["id"], type: node["lang"], name: node["filename"],
118
122
  markers: node["markers"], src: node["src"]
119
123
  ) do |s|
120
- node.children.each { |x| parse(x, s) unless x.name == "name" }
124
+ node.children.each do |x|
125
+ %w(name dl).include?(x.name) and next
126
+ parse(x, s)
127
+ end
121
128
  end
129
+ annotation_parse(node, out)
122
130
  end
123
131
 
124
132
  def pre_parse(node, out)
@@ -130,13 +138,20 @@ module IsoDoc
130
138
 
131
139
  def annotation_parse(node, out)
132
140
  @sourcecode = false
133
- @annotation = true
134
- node.at("./preceding-sibling::*[local-name() = 'annotation']") or
135
- out << "\n\n"
136
- callout = node.at(ns("//callout[@target='#{node['id']}']"))
137
- out << "\n&lt;#{callout.text}&gt; "
138
- out << node&.children&.text&.strip
139
- @annotation = false
141
+ node.at(ns("./annotation")) or return
142
+ out.t { |p| p << @i18n.key }
143
+ out.dl do |dl|
144
+ node.xpath(ns("./annotation")).each do |a|
145
+ annotation_parse1(a, dl)
146
+ end
147
+ end
148
+ end
149
+
150
+ def annotation_parse1(ann, dlist)
151
+ dlist.dt ann.at(ns("//callout[@target='#{ann['id']}']")).text
152
+ dlist.dd do |dd|
153
+ ann.children.each { |n| parse(n, dd) }
154
+ end
140
155
  end
141
156
 
142
157
  def formula_where(dlist, out)
@@ -189,7 +204,7 @@ module IsoDoc
189
204
  end
190
205
 
191
206
  def admonition_name_parse(_node, div, name)
192
- div.t **{ keepWithNext: "true" } do |p|
207
+ div.t keepWithNext: "true" do |p|
193
208
  name.children.each { |n| parse(n, p) }
194
209
  end
195
210
  end
@@ -197,7 +212,7 @@ module IsoDoc
197
212
  def admonition_parse(node, out)
198
213
  type = node["type"]
199
214
  name = admonition_name(node, type)
200
- out.aside **{ anchor: node["id"] } do |t|
215
+ out.aside anchor: node["id"] do |t|
201
216
  admonition_name_parse(node, t, name) if name
202
217
  node.children.each { |n| parse(n, t) unless n.name == "name" }
203
218
  end
@@ -8,14 +8,19 @@ module IsoDoc
8
8
  def table_parse(node, out)
9
9
  @in_table = true
10
10
  out.table **table_attrs(node) do |t|
11
- table_title_parse(node, out)
11
+ table_title_parse(node, t)
12
12
  thead_parse(node, t)
13
13
  tbody_parse(node, t)
14
14
  tfoot_parse(node, t)
15
15
  end
16
+ table_parse_tail(node, out)
17
+ @in_table = false
18
+ end
19
+
20
+ def table_parse_tail(node, out)
16
21
  (dl = node.at(ns("./dl"))) && parse(dl, out)
22
+ node.xpath(ns("./source")).each { |n| parse(n, out) }
17
23
  node.xpath(ns("./note")).each { |n| parse(n, out) }
18
- @in_table = false
19
24
  end
20
25
 
21
26
  def table_title_parse(node, out)
@@ -382,6 +382,9 @@
382
382
  <optional>
383
383
  <ref name="dl"/>
384
384
  </optional>
385
+ <optional>
386
+ <ref name="source"/>
387
+ </optional>
385
388
  </element>
386
389
  </define>
387
390
  <define name="figure">
@@ -404,9 +407,6 @@
404
407
  <attribute name="class"/>
405
408
  </optional>
406
409
  <ref name="BlockAttributes"/>
407
- <optional>
408
- <ref name="source"/>
409
- </optional>
410
410
  <optional>
411
411
  <ref name="tname"/>
412
412
  </optional>
@@ -431,6 +431,20 @@
431
431
  <zeroOrMore>
432
432
  <ref name="note"/>
433
433
  </zeroOrMore>
434
+ <optional>
435
+ <ref name="source"/>
436
+ </optional>
437
+ </element>
438
+ </define>
439
+ <define name="source">
440
+ <element name="source">
441
+ <attribute name="status">
442
+ <ref name="SourceStatusType"/>
443
+ </attribute>
444
+ <ref name="origin"/>
445
+ <optional>
446
+ <ref name="modification"/>
447
+ </optional>
434
448
  </element>
435
449
  </define>
436
450
  <define name="sourcecode">
@@ -2099,10 +2113,7 @@
2099
2113
  <define name="termsource">
2100
2114
  <element name="termsource">
2101
2115
  <attribute name="status">
2102
- <choice>
2103
- <value>identical</value>
2104
- <value>modified</value>
2105
- </choice>
2116
+ <ref name="SourceStatusType"/>
2106
2117
  </attribute>
2107
2118
  <attribute name="type">
2108
2119
  <choice>
@@ -2116,6 +2127,17 @@
2116
2127
  </optional>
2117
2128
  </element>
2118
2129
  </define>
2130
+ <define name="SourceStatusType">
2131
+ <choice>
2132
+ <value>identical</value>
2133
+ <value>modified</value>
2134
+ <value>restyled</value>
2135
+ <value>context-added</value>
2136
+ <value>generalisation</value>
2137
+ <value>specialisation</value>
2138
+ <value>unspecified</value>
2139
+ </choice>
2140
+ </define>
2119
2141
  <define name="origin">
2120
2142
  <element name="origin">
2121
2143
  <choice>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.1.4".freeze
3
+ VERSION = "3.1.5".freeze
4
4
  end
5
5
  end
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_dependency "mathml2asciimath"
40
40
  spec.add_dependency "metanorma-ietf-data"
41
- spec.add_dependency "metanorma-standoc", "~> 2.4.0"
41
+ spec.add_dependency "metanorma-standoc", "~> 2.4.2"
42
42
 
43
43
  spec.add_development_dependency "debug"
44
44
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-13 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mathml2asciimath
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.4.0
47
+ version: 2.4.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.4.0
54
+ version: 2.4.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: debug
57
57
  requirement: !ruby/object:Gem::Requirement