metanorma-ietf 3.5.4 → 3.5.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: 30d6ea179af9c4c095b3e4cb4481ee8cfe136d370e10df652b025c99dd61018f
4
- data.tar.gz: 980f41496222a49f993ad5c12aa83fab68e192787ee93b1995631be4f5af29f0
3
+ metadata.gz: b2bbef6e584be1dd783e7737b1e05b43a6ed524acc3cd3affb2edbe407d3417b
4
+ data.tar.gz: '097b2d98f09a4ff356b7000ba0ccb683194c36a8edfbb9c39895a314f663da68'
5
5
  SHA512:
6
- metadata.gz: 69381efde5d13a2b9453e94ab74d7557fc938295d88cde9b8db80e5229ce306f1c61b90f23887c985dc28e0f61ee2556b96353b6f475a1941a11366800e667d3
7
- data.tar.gz: b03c83fe7b56285eb7ce5884861837274824d3a7bf9d1d5dfb474e1cf8e39a355c3059b293ee311f8c4571f0a53e64f8074e91bae901d87853f8efe4819f2094
6
+ metadata.gz: aab2b309ce5d38c345ffd952fdcbcc07f723b35b2d3d31a2be9301ed0a390d31a8991c83aa6500ec47cfd1b11004f3ef99961ab89f7509168547b281685dc578
7
+ data.tar.gz: 55d97a53151343f37471913d54ee369f847bce6eff6fceb160980e5025a257714a992790562eab342d9be92c071fcbe9ee42309b1185514c14b79bf5698762b7
@@ -3,54 +3,54 @@ module IsoDoc
3
3
  class RfcConvert < ::IsoDoc::Convert
4
4
  def em_parse(node, out)
5
5
  out.em do |e|
6
- node.children.each { |n| parse(n, e) }
6
+ children_parse(node, e)
7
7
  end
8
8
  end
9
9
 
10
10
  def sup_parse(node, out)
11
11
  out.sup do |e|
12
- node.children.each { |n| parse(n, e) }
12
+ children_parse(node, e)
13
13
  end
14
14
  end
15
15
 
16
16
  def sub_parse(node, out)
17
17
  out.sub do |e|
18
- node.children.each { |n| parse(n, e) }
18
+ children_parse(node, e)
19
19
  end
20
20
  end
21
21
 
22
22
  def tt_parse(node, out)
23
23
  out.tt do |e|
24
- node.children.each { |n| parse(n, e) }
24
+ children_parse(node, e)
25
25
  end
26
26
  end
27
27
 
28
28
  def strong_parse(node, out)
29
29
  out.strong do |e|
30
- node.children.each { |n| parse(n, e) }
30
+ children_parse(node, e)
31
31
  end
32
32
  end
33
33
 
34
34
  def bcp14_parse(node, out)
35
35
  out.bcp14 do |e|
36
- node.children.each { |n| parse(n, e) }
36
+ children_parse(node, e)
37
37
  end
38
38
  end
39
39
 
40
40
  def display_text_parse(node, out)
41
- node.children.each { |n| parse(n, out) }
41
+ children_parse(node, out)
42
42
  end
43
43
 
44
44
  def strike_parse(node, out)
45
- node.children.each { |n| parse(n, out) }
45
+ children_parse(node, out)
46
46
  end
47
47
 
48
48
  def smallcap_parse(node, out)
49
- node.children.each { |n| parse(n, out) }
49
+ children_parse(node, out)
50
50
  end
51
51
 
52
52
  def keyword_parse(node, out)
53
- node.children.each { |n| parse(n, out) }
53
+ children_parse(node, out)
54
54
  end
55
55
 
56
56
  def text_parse(node, out)
@@ -65,8 +65,8 @@ module IsoDoc
65
65
  when "MathML"
66
66
  a = node.at(ns("./asciimath"))&.remove
67
67
  a&.children&.text ||
68
- Plurimath::Math
69
- .parse(node.children.to_xml, "mathml").to_asciimath
68
+ Plurimath::Math
69
+ .parse(node.children.to_xml, "mathml").to_asciimath
70
70
  else HTMLEntities.new.encode(node.text)
71
71
  end
72
72
  out << "#{@openmathdelim} #{stem} #{@closemathdelim}"
@@ -85,7 +85,7 @@ module IsoDoc
85
85
  def semx_link_parse(node, out)
86
86
  out.eref **attr_code(target: node["target"],
87
87
  brackets: node["style"]) do |l|
88
- node.children.each { |n| parse(n, l) }
88
+ children_parse(node, l)
89
89
  end
90
90
  end
91
91
 
@@ -183,7 +183,11 @@ module IsoDoc
183
183
  end
184
184
 
185
185
  def span_parse(node, out)
186
- children_parse(node, out)
186
+ if node["class"] == "bcp14"
187
+ bcp14_parse(node, out)
188
+ else
189
+ children_parse(node, out)
190
+ end
187
191
  end
188
192
  end
189
193
  end
@@ -67,7 +67,7 @@ module IsoDoc
67
67
 
68
68
  def error_parse(node, out)
69
69
  case node.name
70
- when "bcp14" then bcp14_parse(node, out)
70
+ when "bcp14" then bcp14_parse(node, out) # legacy
71
71
  when "concept" then concept_parse(node, out)
72
72
  when "display-text" then display_text_parse(node, out)
73
73
  when "verbal-definition", "non-verbal-representation",
@@ -43,12 +43,11 @@ module Metanorma
43
43
  "NOT RECOMMENDED", "OPTIONAL"].freeze
44
44
 
45
45
  def bcp14_cleanup(xmldoc)
46
- return unless @bcp_bold
47
-
46
+ @bcp_bold or return
48
47
  xmldoc.xpath("//strong").each do |s|
49
- next unless BCP_KEYWORDS.include?(s.text)
50
-
51
- s.name = "bcp14"
48
+ BCP_KEYWORDS.include?(s.text) or next
49
+ s["class"] = "bcp14"
50
+ s.name = "span"
52
51
  end
53
52
  end
54
53
 
@@ -56,14 +56,19 @@ module Metanorma
56
56
  when :latexmath then stem_parse(node.text, xml, :latexmath, node)
57
57
  else
58
58
  case node.role
59
- when "bcp14" then xml.bcp14 { |s| s << node.text.upcase }
60
- else
61
- xml << node.text
59
+ when "bcp14" then bcp14(node, xml)
60
+ else xml << node.text
62
61
  end
63
62
  end
64
63
  end
65
64
  end
66
65
 
66
+ def bcp14(node, xml)
67
+ xml.span **{ class: "bcp14" } do |s|
68
+ s << node.text.upcase
69
+ end
70
+ end
71
+
67
72
  def inline_anchor_xref(node)
68
73
  f, c = xref_text(node)
69
74
  f1, c = eref_text(node) if f.nil?
@@ -119,14 +124,14 @@ module Metanorma
119
124
 
120
125
  def norm_ref_preface(sect); end
121
126
 
122
- def clause_parse(attrs, xml, node)
127
+ def clause_attrs_preprocess(attrs, node)
123
128
  attrs[:numbered] = node.attr("numbered")
124
129
  attrs[:removeInRFC] = node.attr("removeInRFC")
125
130
  attrs[:toc] = node.attr("toc")
126
131
  super
127
132
  end
128
133
 
129
- def annex_parse(attrs, xml, node)
134
+ def annex_attrs_preprocess(attrs, node)
130
135
  attrs[:numbered] = node.attr("numbered")
131
136
  attrs[:removeInRFC] = node.attr("removeInRFC")
132
137
  attrs[:toc] = node.attr("toc")
@@ -100,11 +100,6 @@
100
100
  <ref name="note"/>
101
101
  </zeroOrMore>
102
102
  </define>
103
- <define name="ReviewAttributes" combine="interleave">
104
- <optional>
105
- <attribute name="display"/>
106
- </optional>
107
- </define>
108
103
  <define name="NoteAttributes">
109
104
  <optional>
110
105
  <attribute name="removeInRFC"/>
@@ -126,19 +121,6 @@
126
121
  <attribute name="align"/>
127
122
  </optional>
128
123
  </define>
129
- <define name="ImageAttributes" combine="interleave">
130
- <optional>
131
- <attribute name="align"/>
132
- </optional>
133
- </define>
134
- <define name="SourceAttributes" combine="interleave">
135
- <optional>
136
- <attribute name="number"/>
137
- </optional>
138
- <optional>
139
- <attribute name="markers"/>
140
- </optional>
141
- </define>
142
124
  <define name="xref">
143
125
  <element name="xref">
144
126
  <attribute name="target">
@@ -185,17 +167,6 @@
185
167
  <ref name="erefTypeURI"/>
186
168
  </element>
187
169
  </define>
188
- <define name="TableAttributes" combine="interleave">
189
- <optional>
190
- <attribute name="number"/>
191
- </optional>
192
- <optional>
193
- <attribute name="align"/>
194
- </optional>
195
- <optional>
196
- <attribute name="width"/>
197
- </optional>
198
- </define>
199
170
  <define name="Clause-Section">
200
171
  <ref name="Section-Attributes"/>
201
172
  <optional>
@@ -288,18 +259,30 @@
288
259
  <ref name="index-tertiary"/>
289
260
  </element>
290
261
  </define>
262
+ <define name="TextElement" combine="choice">
263
+ <ref name="review"/>
264
+ </define>
291
265
  </include>
292
266
  <!-- end overrides -->
293
- <define name="TextElement" combine="choice">
294
- <choice>
295
- <ref name="bcp14"/>
296
- <ref name="review"/>
297
- </choice>
267
+ <define name="ReviewAttributes" combine="interleave">
268
+ <optional>
269
+ <attribute name="display"/>
270
+ </optional>
298
271
  </define>
299
- <define name="bcp14">
300
- <element name="bcp14">
301
- <text/>
302
- </element>
272
+ <define name="ImageAttributes" combine="interleave">
273
+ <optional>
274
+ <attribute name="align"/>
275
+ </optional>
276
+ </define>
277
+ <define name="SourceAttributes" combine="interleave">
278
+ <optional>
279
+ <attribute name="markers"/>
280
+ </optional>
281
+ </define>
282
+ <define name="TableAttributes" combine="interleave">
283
+ <optional>
284
+ <attribute name="align"/>
285
+ </optional>
303
286
  </define>
304
287
  <define name="erefTypeURI">
305
288
  <optional>
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
- <!-- VERSION v2.0.3 -->
3
+ <!-- VERSION v2.0.4 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -1328,6 +1328,7 @@ numbers</a:documentation>
1328
1328
  <ref name="foreword"/>
1329
1329
  <ref name="introduction"/>
1330
1330
  <ref name="acknowledgements"/>
1331
+ <ref name="executivesummary"/>
1331
1332
  </choice>
1332
1333
  </oneOrMore>
1333
1334
  </element>
@@ -1351,6 +1352,11 @@ numbers</a:documentation>
1351
1352
  <ref name="Content-Section"/>
1352
1353
  </element>
1353
1354
  </define>
1355
+ <define name="executivesummary">
1356
+ <element name="executivesummary">
1357
+ <ref name="Content-Section"/>
1358
+ </element>
1359
+ </define>
1354
1360
  <define name="indexsect">
1355
1361
  <element name="indexsect">
1356
1362
  <ref name="Content-Section"/>
@@ -1576,6 +1582,15 @@ used in document amendments</a:documentation>
1576
1582
  <define name="annex">
1577
1583
  <element name="annex">
1578
1584
  <ref name="Annex-Section"/>
1585
+ <zeroOrMore>
1586
+ <ref name="annex-appendix"/>
1587
+ </zeroOrMore>
1588
+ </element>
1589
+ </define>
1590
+ <define name="annex-appendix">
1591
+ <a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
1592
+ <element name="appendix">
1593
+ <ref name="Clause-Section"/>
1579
1594
  </element>
1580
1595
  </define>
1581
1596
  <define name="terms">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.5.4".freeze
3
+ VERSION = "3.5.5".freeze
4
4
  end
5
5
  end
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.5.4
4
+ version: 3.5.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: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-ietf-data