metanorma-ietf 3.0.14 → 3.1.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: 40e5744277a667f2a455b01732d3046b971b970f5595699b70d538878d12955c
4
- data.tar.gz: bef96ca465afbff1b334559292519dd87078f16339ad92195572376e4edd04bf
3
+ metadata.gz: a4d0bbd3e456f5931f3ed658e68543d2026df26a3a09c6b30d8a5e79e7111070
4
+ data.tar.gz: 0f494d74e351587cc0927be2eefd7c749f36d73572317b1ca294c04c3c80ec2f
5
5
  SHA512:
6
- metadata.gz: a49bc780a557a34b826081241e1b65f8a726b8110f3ef6fe847e3d2e17836471b0fb83579d45d9c8c124997887f124b9adb1fba487ff91d429426fd75a6c00d0
7
- data.tar.gz: 053710a2bd8ee14940755433d5daeab3542863d3e1fe467470042a72c44220dc5c526850b2b0120bcfc4237d7000e4089f2203e48529219ab4fe7133ae20f8b9
6
+ metadata.gz: 4e9c9d9fea112a2a1d82720a98a3dbb945d9ba478429c09a319316e6fb93654c7cdcc8b58274916ae55834f7a799c3e959d9dfbb4ef8806820d29b681a7b565b
7
+ data.tar.gz: ba76888850b0540bc9674f5ce5881926227299f7277c807c1d4d46af319029f98eb51a563e21f0f04c1b81748cc10e2e1bc29fac6283c3cd5d08ce5ece2e242e
data/.gitignore CHANGED
@@ -19,7 +19,6 @@
19
19
 
20
20
  .rubocop-https--*
21
21
 
22
- /Gemfile.devel
23
22
  /Gemfile.lock
24
23
  /test.err
25
24
  /test.rfc.xml.err
@@ -99,9 +99,9 @@ module IsoDoc
99
99
  c = a&.xpath("./following-sibling::*")&.remove
100
100
  a = a.remove
101
101
  name and f << name
102
- b.empty? or f << "<preamble>#{b.to_xml}</preamble>"
102
+ b.empty? or f << "<preamble>#{to_xml(b)}</preamble>"
103
103
  a and f << a
104
- c.empty? or f << "<postamble>#{c.to_xml}</postamble>"
104
+ c.empty? or f << "<postamble>#{to_xml(c)}</postamble>"
105
105
  end
106
106
  end
107
107
 
@@ -127,11 +127,11 @@ module IsoDoc
127
127
  # for markup in pseudocode
128
128
  def sourcecode_cleanup(docxml)
129
129
  docxml.xpath("//sourcecode").each do |s|
130
- s.children = s.children.to_xml.gsub(%r{<br/>\n}, "\n")
130
+ s.children = to_xml(s.children).gsub(%r{<br/>\n}, "\n")
131
131
  .gsub(%r{\s+(<t[ >])}, "\\1").gsub(%r{</t>\s+}, "</t>")
132
132
  sourcecode_remove_markup(s)
133
- s.children = "<![CDATA[#{HTMLEntities.new.decode(s
134
- .children.to_xml.sub(/\A\n+/, ''))}]]>"
133
+ s.children = "<![CDATA[#{HTMLEntities.new.decode(to_xml(s
134
+ .children).sub(/\A\n+/, ''))}]]>"
135
135
  end
136
136
  end
137
137
 
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  def footnote_cleanup(docxml)
15
15
  fn = footnote_refs_cleanup(docxml)
16
16
  endnotes = make_endnotes(docxml)
17
- docxml.xpath("//section[descendant::fn] | "\
17
+ docxml.xpath("//section[descendant::fn] | " \
18
18
  "//abstract[descendant::fn]").each do |s|
19
19
  s.xpath(".//fn").each do |f|
20
20
  ref = f.at(".//ref") and ref.replace("[#{fn[ref.text]}] ")
@@ -2,6 +2,7 @@ module IsoDoc::Ietf
2
2
  class RfcConvert < ::IsoDoc::Convert
3
3
  def footnote_parse(node, out)
4
4
  return table_footnote_parse(node, out) if @in_table || @in_figure
5
+
5
6
  fn = node["reference"]
6
7
  out.fnref fn
7
8
  make_local_footnote(node, fn, out)
@@ -9,6 +10,7 @@ module IsoDoc::Ietf
9
10
 
10
11
  def make_local_footnote(node, fn, out)
11
12
  return if @seen_footnote.include?(fn)
13
+
12
14
  @in_footnote = true
13
15
  out << make_generic_footnote_text(node, fn)
14
16
  @in_footnote = false
@@ -18,13 +20,13 @@ module IsoDoc::Ietf
18
20
  def make_generic_footnote_text(node, fnref)
19
21
  first = node.first_element_child
20
22
  noko do |xml|
21
- xml.fn do |div|
23
+ xml.fn do |_div|
22
24
  xml.t **attr_code(anchor: first ? first["id"] : nil) do |div|
23
25
  div.ref fnref
24
26
  first.name == "p" and first.children.each { |n| parse(n, div) }
25
27
  end
26
- first.name == "p" and
27
- node.elements.drop(1).each { |n| parse(n, xml) } or
28
+ (first.name == "p" and
29
+ node.elements.drop(1).each { |n| parse(n, xml) }) or
28
30
  node.children.each { |n| parse(n, xml) }
29
31
  end
30
32
  end.join
@@ -36,6 +38,7 @@ module IsoDoc::Ietf
36
38
  make_table_footnote_link(out, tid + fn, fn)
37
39
  # do not output footnote text if we have already seen it for this table
38
40
  return if @seen_footnote.include?(tid + fn)
41
+
39
42
  @in_footnote = true
40
43
  out.fn do |a|
41
44
  a << make_table_footnote_text(node, tid + fn, fn)
@@ -44,19 +47,19 @@ module IsoDoc::Ietf
44
47
  @seen_footnote << (tid + fn)
45
48
  end
46
49
 
47
- def make_table_footnote_link(out, fnid, fnref)
50
+ def make_table_footnote_link(out, _fnid, fnref)
48
51
  out << " [#{fnref}]"
49
52
  end
50
53
 
51
- def make_table_footnote_text(node, fnid, fnref)
54
+ def make_table_footnote_text(node, _fnid, fnref)
52
55
  first = node.first_element_child
53
56
  noko do |xml|
54
57
  xml.t **attr_code(anchor: first ? first["id"] : nil) do |div|
55
58
  div << "[#{fnref}] "
56
59
  first.name == "p" and first.children.each { |n| parse(n, div) }
57
60
  end
58
- first.name == "p" and
59
- node.elements.drop(1).each { |n| parse(n, xml) } or
61
+ (first.name == "p" and
62
+ node.elements.drop(1).each { |n| parse(n, xml) }) or
60
63
  node.children.each { |n| parse(n, xml) }
61
64
  end.join
62
65
  end
@@ -64,6 +67,7 @@ module IsoDoc::Ietf
64
67
  def get_table_ancestor_id(node)
65
68
  table = node.ancestors("table") || node.ancestors("figure")
66
69
  return UUIDTools::UUID.random_create.to_s if table.empty?
70
+
67
71
  table.last["id"]
68
72
  end
69
73
  end
@@ -112,7 +112,7 @@ module IsoDoc
112
112
  end
113
113
  contents = no_loc_contents.select { |c| !c.text? || /\S/.match(c) }
114
114
  !contents.empty? and
115
- return Nokogiri::XML::NodeSet.new(node.document, contents).to_xml
115
+ return to_xml(Nokogiri::XML::NodeSet.new(node.document, contents))
116
116
  ""
117
117
  end
118
118
 
@@ -120,19 +120,27 @@ module IsoDoc
120
120
  linkend = node.children.reject do |c|
121
121
  %w{locality localityStack}.include? c.name
122
122
  end
123
- relative = node["relative"] ||
124
- node.at(ns(".//locality[@type = 'anchor']/referenceFrom"))&.text || ""
125
- section = @isodoc.eref_localities(
126
- node.xpath(ns("./locality | ./localityStack")), nil, node
127
- )&.sub(/^,/, "")&.sub(/^\s*(Section|Clause)/, "")&.strip&.sub(/,$/, "") || ""
128
123
  # section = "" unless relative.empty?
129
- out.relref **attr_code(target: node["bibitemid"], section: section,
130
- relative: relative,
124
+ out.relref **attr_code(target: node["bibitemid"],
125
+ section: eref_section(node),
126
+ relative: eref_relative(node),
131
127
  displayFormat: node["displayFormat"]) do |l|
132
128
  linkend.each { |n| parse(n, l) }
133
129
  end
134
130
  end
135
131
 
132
+ def eref_relative(node)
133
+ node["relative"] ||
134
+ node.at(ns(".//locality[@type = 'anchor']/referenceFrom"))&.text || ""
135
+ end
136
+
137
+ def eref_section(node)
138
+ @isodoc.eref_localities(
139
+ node.xpath(ns("./locality | ./localityStack")), nil, node
140
+ )&.sub(/^,/, "")&.sub(/^\s*(Sections?|Clauses?)/, "")&.strip
141
+ &.sub(/,$/, "") || ""
142
+ end
143
+
136
144
  def index_parse(node, out)
137
145
  out.iref nil, **attr_code(item: node.at(ns("./primary")).text,
138
146
  primary: node["primary"],
@@ -683,6 +683,9 @@
683
683
  </define>
684
684
  <define name="underline">
685
685
  <element name="underline">
686
+ <optional>
687
+ <attribute name="style"/>
688
+ </optional>
686
689
  <zeroOrMore>
687
690
  <ref name="PureTextElement"/>
688
691
  </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">
@@ -571,6 +571,11 @@
571
571
  <ref name="MultilingualRenderingType"/>
572
572
  </attribute>
573
573
  </optional>
574
+ <optional>
575
+ <attribute name="linenums">
576
+ <data type="boolean"/>
577
+ </attribute>
578
+ </optional>
574
579
  <optional>
575
580
  <ref name="tname"/>
576
581
  </optional>
@@ -1238,6 +1243,11 @@
1238
1243
  </define>
1239
1244
  <define name="concept">
1240
1245
  <element name="concept">
1246
+ <optional>
1247
+ <attribute name="bold">
1248
+ <data type="boolean"/>
1249
+ </attribute>
1250
+ </optional>
1241
1251
  <optional>
1242
1252
  <attribute name="ital">
1243
1253
  <data type="boolean"/>
@@ -2653,6 +2663,7 @@
2653
2663
  <value>full</value>
2654
2664
  <value>short</value>
2655
2665
  <value>id</value>
2666
+ <text/>
2656
2667
  </choice>
2657
2668
  </define>
2658
2669
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.0.14".freeze
3
+ VERSION = "3.1.1".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.2.4"
41
+ spec.add_dependency "metanorma-standoc", "~> 2.3.0"
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.0.14
4
+ version: 3.1.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-21 00:00:00.000000000 Z
11
+ date: 2022-12-19 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.2.4
47
+ version: 2.3.0
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.2.4
54
+ version: 2.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: debug
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  - !ruby/object:Gem::Version
294
294
  version: '0'
295
295
  requirements: []
296
- rubygems_version: 3.3.7
296
+ rubygems_version: 3.3.26
297
297
  signing_key:
298
298
  specification_version: 4
299
299
  summary: metanorma-ietf lets you write IETF documents, such as Internet-Drafts and