metanorma-ietf 3.5.0 → 3.5.1

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: 390603e9e2284f8f9d4a296e2b2477145d68db6860bf89518bf12a38eaec4de6
4
- data.tar.gz: ecb70e48ac54f68e4b486aafdc0af99792834dcedc781e94da78b88a75ddb0cd
3
+ metadata.gz: da1665019f44fcc0eb18a283049b279819b7e185818f1f0722c7933c92a226aa
4
+ data.tar.gz: 4b4defd2a8b051c5174f3f45c93035b7eee50b812448863f42f8eb435f126b0f
5
5
  SHA512:
6
- metadata.gz: 90f627b63a727c2a022db91718237058c8309b892bd39cbc5991685a8daa6362639503caf8cc06fd60eabcb0bb3b36a671fbd9d018e00e7fe41f11261b4f4fea
7
- data.tar.gz: e6178e44010dbbddf74aa1b4120a3be44e1c24dc076577a70751a58e88cb7ebfa0b0cc9bf3a1b666776c7afb2b883516e00edc93099a14f7ac966039cfc0698e
6
+ metadata.gz: f80bd6987bc38d3dedd539c2573bfd458cdbb9911a03370f0e7a5bc40804076c6bb28e15fa970fe90473c7827aa8f29b77aec5d66ee6533da7a1d284cda4987e
7
+ data.tar.gz: 4caff92a476ea68f7a99112c808c6f09344a3f2f2e38f9dd56dfc462ae23f948cbedce37532f2f82e02b2fbf8c2e950b7bec2882ab5c09b903f4d201fb2a0183
@@ -19,86 +19,6 @@ module IsoDoc
19
19
  node.xpath(ns("./note")).each { |n| parse(n, out) }
20
20
  end
21
21
 
22
- def ul_attrs(node)
23
- { anchor: node["id"], empty: node["nobullet"],
24
- indent: node["indent"], bare: node["bare"],
25
- spacing: node["spacing"] }
26
- end
27
-
28
- def ul_parse(node, out)
29
- out.ul **attr_code(ul_attrs(node)) do |ul|
30
- node.children.each { |n| parse(n, ul) }
31
- end
32
- end
33
-
34
- OL_STYLE = {
35
- arabic: "1",
36
- roman: "i",
37
- alphabet: "a",
38
- roman_upper: "I",
39
- alphabet_upper: "A",
40
- }.freeze
41
-
42
- def ol_style(type)
43
- OL_STYLE[type&.to_sym] || type
44
- end
45
-
46
- def ol_attrs(node)
47
- { anchor: node["id"],
48
- spacing: node["spacing"], indent: node["indent"],
49
- type: ol_style(node["type"]),
50
- group: node["group"], start: node["start"] }
51
- end
52
-
53
- def ol_parse(node, out)
54
- out.ol **attr_code(ol_attrs(node)) do |ol|
55
- node.children.each { |n| parse(n, ol) }
56
- end
57
- end
58
-
59
- def dl_attrs(node)
60
- attr_code(anchor: node["id"], newline: node["newline"],
61
- indent: node["indent"], spacing: node["spacing"])
62
- end
63
-
64
- def dl_parse(node, out)
65
- list_title_parse(node, out)
66
- out.dl **dl_attrs(node) do |v|
67
- node.elements.select { |n| dt_dd? n }.each_slice(2) do |dt, dd|
68
- dl_parse1(v, dt, dd)
69
- end
70
- end
71
- dl_parse_notes(node, out)
72
- end
73
-
74
- def dt_parse(dterm, term)
75
- if dterm.elements.empty? then term << dterm.text
76
- else dterm.children.each { |n| parse(n, term) }
77
- end
78
- end
79
-
80
- def dl_parse1(dlist, dterm, ddef)
81
- dlist.dt **attr_code(anchor: dterm["id"]) do |term|
82
- dt_parse(dterm, term)
83
- end
84
- dlist.dd **attr_code(anchor: ddef["id"]) do |listitem|
85
- ddef.children.each { |n| parse(n, listitem) }
86
- end
87
- end
88
-
89
- def li_parse(node, out)
90
- out.li **attr_code(anchor: node["id"]) do |li|
91
- if node["uncheckedcheckbox"] == "true"
92
- li << '<span class="zzMoveToFollowing">' \
93
- '<input type="checkbox" checked="checked"/></span>'
94
- elsif node["checkedcheckbox"] == "true"
95
- li << '<span class="zzMoveToFollowing">' \
96
- '<input type="checkbox"/></span>'
97
- end
98
- node.children.each { |n| parse(n, li) }
99
- end
100
- end
101
-
102
22
  def note_label(node)
103
23
  n = @xrefs.get[node["id"]]
104
24
  n.nil? || n[:label].nil? || n[:label].empty? and
@@ -142,12 +62,12 @@ module IsoDoc
142
62
  end
143
63
 
144
64
  def sourcecode_parse(node, out)
65
+ b = node.at(ns("./body"))
145
66
  out.sourcecode **attr_code(
146
67
  anchor: node["id"], type: node["lang"], name: node["filename"],
147
68
  markers: node["markers"], src: node["src"]
148
69
  ) do |s|
149
- node.children.each do |x|
150
- %w(name dl).include?(x.name) and next
70
+ b&.children&.each do |x|
151
71
  parse(x, s)
152
72
  end
153
73
  end
@@ -261,7 +181,15 @@ module IsoDoc
261
181
  end
262
182
 
263
183
  def pseudocode_parse(node, out)
264
- sourcecode_parse(node, out)
184
+ out.sourcecode **attr_code(
185
+ anchor: node["id"], type: node["lang"], name: node["filename"],
186
+ markers: node["markers"], src: node["src"]
187
+ ) do |s|
188
+ node.children.each do |x|
189
+ %w(name dl).include?(x.name) and next
190
+ parse(x, s)
191
+ end
192
+ end
265
193
  end
266
194
 
267
195
  def figure_parse(node, out)
@@ -0,0 +1,85 @@
1
+ module IsoDoc
2
+ module Ietf
3
+ class RfcConvert < ::IsoDoc::Convert
4
+ def ul_attrs(node)
5
+ { anchor: node["id"], empty: node["nobullet"],
6
+ indent: node["indent"], bare: node["bare"],
7
+ spacing: node["spacing"] }
8
+ end
9
+
10
+ def ul_parse(node, out)
11
+ out.ul **attr_code(ul_attrs(node)) do |ul|
12
+ node.children.each { |n| parse(n, ul) }
13
+ end
14
+ end
15
+
16
+ OL_STYLE = {
17
+ arabic: "1",
18
+ roman: "i",
19
+ alphabet: "a",
20
+ roman_upper: "I",
21
+ alphabet_upper: "A",
22
+ }.freeze
23
+
24
+ def ol_style(type)
25
+ OL_STYLE[type&.to_sym] || type
26
+ end
27
+
28
+ def ol_attrs(node)
29
+ { anchor: node["id"],
30
+ spacing: node["spacing"], indent: node["indent"],
31
+ type: ol_style(node["type"]),
32
+ group: node["group"], start: node["start"] }
33
+ end
34
+
35
+ def ol_parse(node, out)
36
+ out.ol **attr_code(ol_attrs(node)) do |ol|
37
+ node.children.each { |n| parse(n, ol) }
38
+ end
39
+ end
40
+
41
+ def dl_attrs(node)
42
+ attr_code(anchor: node["id"], newline: node["newline"],
43
+ indent: node["indent"], spacing: node["spacing"])
44
+ end
45
+
46
+ def dl_parse(node, out)
47
+ list_title_parse(node, out)
48
+ out.dl **dl_attrs(node) do |v|
49
+ node.elements.select { |n| dt_dd? n }.each_slice(2) do |dt, dd|
50
+ dl_parse1(v, dt, dd)
51
+ end
52
+ end
53
+ dl_parse_notes(node, out)
54
+ end
55
+
56
+ def dt_parse(dterm, term)
57
+ if dterm.elements.empty? then term << dterm.text
58
+ else dterm.children.each { |n| parse(n, term) }
59
+ end
60
+ end
61
+
62
+ def dl_parse1(dlist, dterm, ddef)
63
+ dlist.dt **attr_code(anchor: dterm["id"]) do |term|
64
+ dt_parse(dterm, term)
65
+ end
66
+ dlist.dd **attr_code(anchor: ddef["id"]) do |listitem|
67
+ ddef.children.each { |n| parse(n, listitem) }
68
+ end
69
+ end
70
+
71
+ def li_parse(node, out)
72
+ out.li **attr_code(anchor: node["id"]) do |li|
73
+ if node["uncheckedcheckbox"] == "true"
74
+ li << '<span class="zzMoveToFollowing">' \
75
+ '<input type="checkbox" checked="checked"/></span>'
76
+ elsif node["checkedcheckbox"] == "true"
77
+ li << '<span class="zzMoveToFollowing">' \
78
+ '<input type="checkbox"/></span>'
79
+ end
80
+ node.children.each { |n| parse(n, li) }
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
@@ -1,5 +1,6 @@
1
1
  require_relative "./terms"
2
2
  require_relative "./blocks"
3
+ require_relative "./lists"
3
4
  require_relative "./metadata"
4
5
  require_relative "./front"
5
6
  require_relative "./table"
@@ -67,7 +68,8 @@ module IsoDoc
67
68
  when "bcp14" then bcp14_parse(node, out)
68
69
  when "concept" then concept_parse(node, out)
69
70
  when "display-text" then display_text_parse(node, out)
70
- when "verbal-definition", "non-verbal-representation", "fmt-provision"
71
+ when "verbal-definition", "non-verbal-representation",
72
+ "fmt-provision"
71
73
  node.elements.each { |n| parse(n, out) }
72
74
  else
73
75
  text = node.to_xml.gsub(/</, "&lt;").gsub(/>/, "&gt;")
@@ -599,17 +599,9 @@ It is included for convenience, in case processing the citation to extract the a
599
599
  <a:documentation>The caption of the block</a:documentation>
600
600
  </ref>
601
601
  </optional>
602
- <oneOrMore>
603
- <choice>
604
- <text>
605
- <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
606
- (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
607
- </text>
608
- <ref name="callout">
609
- <a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
610
- </ref>
611
- </choice>
612
- </oneOrMore>
602
+ <ref name="sourcecodebody">
603
+ <a:documentation>The sourcecode content</a:documentation>
604
+ </ref>
613
605
  <zeroOrMore>
614
606
  <ref name="annotation">
615
607
  <a:documentation>Annotations to the source code; each annotation consists of zero or more paragraphs,
@@ -628,17 +620,9 @@ and is intended to be referenced by a callout within the source code</a:document
628
620
  <a:documentation>The caption of the block</a:documentation>
629
621
  </ref>
630
622
  </optional>
631
- <oneOrMore>
632
- <choice>
633
- <text>
634
- <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
635
- (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
636
- </text>
637
- <ref name="callout">
638
- <a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
639
- </ref>
640
- </choice>
641
- </oneOrMore>
623
+ <ref name="sourcecodebody">
624
+ <a:documentation>The sourcecode content</a:documentation>
625
+ </ref>
642
626
  <zeroOrMore>
643
627
  <ref name="annotation">
644
628
  <a:documentation>Annotations to the source code; each annotation consists of zero or more paragraphs,
@@ -651,6 +635,20 @@ and is intended to be referenced by a callout within the source code</a:document
651
635
  </ref>
652
636
  </zeroOrMore>
653
637
  </define>
638
+ <define name="sourcecodebody">
639
+ <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
640
+ (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
641
+ <element name="body">
642
+ <oneOrMore>
643
+ <choice>
644
+ <text/>
645
+ <ref name="callout">
646
+ <a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
647
+ </ref>
648
+ </choice>
649
+ </oneOrMore>
650
+ </element>
651
+ </define>
654
652
  <define name="pre">
655
653
  <a:documentation>Pre-formatted block. Wrapper for text to be rendered with fixed-width typeface, and preserving spaces including line breaks.
656
654
  They are intended for a restricted number of functions, most typically ASCII Art (which is still in prominent use in some
@@ -1672,18 +1670,25 @@ which can be bookmarks as well as block or section references</a:documentation>
1672
1670
  </optional>
1673
1671
  </define>
1674
1672
  <define name="XrefBody">
1675
- <oneOrMore>
1676
- <ref name="PureTextElement">
1677
- <a:documentation>The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `&lt;xx&gt;my link text&lt;/xx&gt;`)</a:documentation>
1678
- </ref>
1679
- </oneOrMore>
1673
+ <a:documentation>The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `&lt;xx&gt;my link text&lt;/xx&gt;`)</a:documentation>
1674
+ <optional>
1675
+ <element name="display-text">
1676
+ <oneOrMore>
1677
+ <ref name="PureTextElement"/>
1678
+ </oneOrMore>
1679
+ </element>
1680
+ </optional>
1680
1681
  </define>
1681
1682
  <define name="ErefBody">
1682
- <oneOrMore>
1683
- <ref name="PureTextElement">
1684
- <a:documentation>The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `&lt;xx&gt;my link text&lt;/xx&gt;`)</a:documentation>
1685
- </ref>
1686
- </oneOrMore>
1683
+ <optional>
1684
+ <element name="display-text">
1685
+ <oneOrMore>
1686
+ <ref name="PureTextElement">
1687
+ <a:documentation>The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `&lt;xx&gt;my link text&lt;/xx&gt;`)</a:documentation>
1688
+ </ref>
1689
+ </oneOrMore>
1690
+ </element>
1691
+ </optional>
1687
1692
  </define>
1688
1693
  <define name="fn">
1689
1694
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
@@ -35,7 +35,7 @@ module Metanorma
35
35
  xml.title **attr_code(at.merge(type: "main")) do |t|
36
36
  t << (::Metanorma::Utils::asciidoc_sub(node.attr("title")) ||
37
37
  ::Metanorma::Utils::asciidoc_sub(node.attr("title-en")) ||
38
- node.title)
38
+ ::Metanorma::Utils::asciidoc_sub(node.attr("doctitle")))
39
39
  end
40
40
  a = node.attr("abbrev") and
41
41
  xml.title a, **attr_code(at.merge(type: "abbrev"))
@@ -245,23 +245,9 @@
245
245
  <a:documentation>The caption of the block</a:documentation>
246
246
  </ref>
247
247
  </optional>
248
- <oneOrMore>
249
- <choice>
250
- <text>
251
- <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
252
- (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
253
- </text>
254
- <ref name="callout">
255
- <a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
256
- </ref>
257
- <ref name="xref">
258
- <a:documentation>Hyperlink of code segment to another part of the document</a:documentation>
259
- </ref>
260
- <ref name="eref">
261
- <a:documentation>Hyperlink of code segment to external bibliographic resource</a:documentation>
262
- </ref>
263
- </choice>
264
- </oneOrMore>
248
+ <ref name="sourcecodebody">
249
+ <a:documentation>The sourcecode content</a:documentation>
250
+ </ref>
265
251
  <zeroOrMore>
266
252
  <ref name="annotation">
267
253
  <a:documentation>Annotations to the source code; each annotation consists of zero or more paragraphs,
@@ -277,6 +263,26 @@ and is intended to be referenced by a callout within the source code</a:document
277
263
  <a:documentation>A source for the block</a:documentation>
278
264
  </ref>
279
265
  </define>
266
+ <define name="sourcecodebody">
267
+ <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
268
+ (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
269
+ <element name="body">
270
+ <oneOrMore>
271
+ <choice>
272
+ <text/>
273
+ <ref name="callout">
274
+ <a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
275
+ </ref>
276
+ <ref name="xref">
277
+ <a:documentation>Hyperlink of code segment to another part of the document</a:documentation>
278
+ </ref>
279
+ <ref name="eref">
280
+ <a:documentation>Hyperlink of code segment to external bibliographic resource</a:documentation>
281
+ </ref>
282
+ </choice>
283
+ </oneOrMore>
284
+ </element>
285
+ </define>
280
286
  <define name="sections">
281
287
  <element name="sections">
282
288
  <oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.5.0".freeze
3
+ VERSION = "3.5.1".freeze
4
4
  end
5
5
  end
@@ -115,6 +115,7 @@ module Relaton
115
115
 
116
116
  def stream(doc)
117
117
  a = doc.series.detect { |s| s.type == "stream" } or return nil
118
+ a.title&.title&.content == "Legacy" and return nil
118
119
  series_title(a, doc)
119
120
  end
120
121
 
@@ -46,7 +46,8 @@ Gem::Specification.new do |spec|
46
46
  spec.add_development_dependency "guard-rspec", "~> 4.7"
47
47
  spec.add_development_dependency "rake", "~> 13.0"
48
48
  spec.add_development_dependency "rspec", "~> 3.6"
49
- spec.add_development_dependency "rubocop", "~> 1.5.2"
49
+ spec.add_development_dependency "rubocop", "~> 1"
50
+ spec.add_development_dependency "rubocop-performance"
50
51
  spec.add_development_dependency "simplecov", "~> 0.15"
51
52
  spec.add_development_dependency "timecop", "~> 0.9"
52
53
  spec.add_development_dependency "vcr", "~> 6.1.0"
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.0
4
+ version: 3.5.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: 2025-02-17 00:00:00.000000000 Z
11
+ date: 2025-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-ietf-data
@@ -142,14 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.5.2
145
+ version: '1'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.5.2
152
+ version: '1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-performance
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: simplecov
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -258,6 +272,7 @@ files:
258
272
  - lib/isodoc/ietf/i18n.rb
259
273
  - lib/isodoc/ietf/init.rb
260
274
  - lib/isodoc/ietf/inline.rb
275
+ - lib/isodoc/ietf/lists.rb
261
276
  - lib/isodoc/ietf/metadata.rb
262
277
  - lib/isodoc/ietf/references.rb
263
278
  - lib/isodoc/ietf/reqt.rb
@@ -313,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
313
328
  - !ruby/object:Gem::Version
314
329
  version: '0'
315
330
  requirements: []
316
- rubygems_version: 3.3.27
331
+ rubygems_version: 3.5.22
317
332
  signing_key:
318
333
  specification_version: 4
319
334
  summary: metanorma-ietf lets you write IETF documents, such as Internet-Drafts and