metanorma-ietf 3.6.8 → 3.7.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: 17bcabceaa3266e27009fca291f497dbda0bac6f31d48e9cb4aeb51653721682
4
- data.tar.gz: 29a033f30aebf8a6c9b5127178617e2049696067746014d482145190309ff3ee
3
+ metadata.gz: aeb0c94430f5b3ed24a329a89529c6921e7ca6074426f804bbf6691976282269
4
+ data.tar.gz: a479f966ab1f10d217afd1b4340131f5fe7d2d83f79d8e50f67bf2cb0e4d7ff9
5
5
  SHA512:
6
- metadata.gz: f897268efa4c788332b8cd18f4d63c67094263bf1030028f01124209ddbf21778ffc1a3cb8bf82a70e550cd5ddbab216ff10a64316385c6eee7771185a986472
7
- data.tar.gz: 4babd7a444518b0a712d06265c23040da702ff4d707d2f1dea4d2af90913e61bdff952d44405e0761dc0c9b2b263c8336d467b093b053a1e8850a07992a2db89
6
+ metadata.gz: e758b0d51003ed797dbc6d9972535d8946ddf47a9c640f9f076e1db5991d414b3d87aee4c3a60a84cc902b02fd2abf35e647921c20297403f6feca543587dfac
7
+ data.tar.gz: 3a0fe42165b028986bf7e6cdd77768ff554507e83f9bad29bc6ebd633439ff9b3c07917235bb5ac966bd5445f0e94c6770e6284ac2034cf841a573a0ea60c9b6
@@ -118,9 +118,9 @@ module IsoDoc
118
118
 
119
119
  def formula_parse(node, out)
120
120
  formula_parse1(node, out)
121
- formula_where(node.at(ns("./dl")), out)
121
+ formula_where(node.at(ns("./key")), out)
122
122
  node.children.each do |n|
123
- %w(stem dl).include? n.name and next
123
+ %w(stem dl key).include? n.name and next
124
124
  parse(n, out)
125
125
  end
126
126
  end
@@ -213,6 +213,16 @@ module IsoDoc
213
213
  end
214
214
 
215
215
  def toc_parse(_node, _out); end
216
+
217
+ def key_parse(node, out)
218
+ node.children.each do |n|
219
+ if n.name == "name"
220
+ key_name_parse(n, out)
221
+ "<p keep-with-next='true'><strong>#{@i18n.key}</strong></p>"
222
+ else parse(n, out)
223
+ end
224
+ end
225
+ end
216
226
  end
217
227
  end
218
228
  end
@@ -96,17 +96,8 @@ module IsoDoc
96
96
  alt: node["alt"] }
97
97
  end
98
98
 
99
- def image_parse(node, out, caption)
99
+ def image_parse(node, out)
100
100
  out.artwork **attr_code(image_parse_attrs(node))
101
- image_title_parse(out, caption)
102
- end
103
-
104
- def image_title_parse(out, caption)
105
- unless caption.nil?
106
- out.t align: "center", keepWithPrevious: "true" do |p|
107
- p << caption.to_s
108
- end
109
- end
110
101
  end
111
102
 
112
103
  def svg_parse(node, out)
@@ -18,7 +18,7 @@ module IsoDoc
18
18
  end
19
19
 
20
20
  def table_parse_tail(node, out)
21
- (dl = node.at(ns("./dl"))) && parse(dl, out)
21
+ (key = node.at(ns("./key"))) && parse(key, out)
22
22
  node.xpath(ns("./source")).each { |n| parse(n, out) }
23
23
  node.xpath(ns("./note")).each { |n| parse(n, out) }
24
24
  end
@@ -208,11 +208,15 @@ Applicable to modify and delete</a:documentation>
208
208
  </zeroOrMore>
209
209
  <optional>
210
210
  <element name="newcontent">
211
- <a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
211
+ <a:documentation>New content to be added to the document; applicable to add and modify.
212
+ Can be blocks and/or sections</a:documentation>
212
213
  <ref name="OptionalId"/>
213
214
  <zeroOrMore>
214
215
  <ref name="BasicBlock"/>
215
216
  </zeroOrMore>
217
+ <zeroOrMore>
218
+ <ref name="section"/>
219
+ </zeroOrMore>
216
220
  </element>
217
221
  </optional>
218
222
  <zeroOrMore>
@@ -8,6 +8,7 @@ module Metanorma
8
8
  "keep-with-previous": node.attr("keepWithPrevious") ||
9
9
  node.attr("keep-with-previous"),
10
10
  indent: node.attr("indent"),
11
+ key: node.option?("key") ? "true" : nil,
11
12
  ))
12
13
  end
13
14
 
@@ -35,6 +36,7 @@ module Metanorma
35
36
  newline: node.attr("newline"),
36
37
  indent: node.attr("indent"),
37
38
  spacing: node.attr("spacing"),
39
+ key: node.option?("key") ? "true" : nil,
38
40
  ))
39
41
  end
40
42
 
@@ -1,6 +1,10 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- class Converter < ::Metanorma::Standoc::Converter
3
+ class Cleanup < ::Metanorma::Standoc::Cleanup
4
+ def copied_instance_variables
5
+ super + %i[bcp_bold]
6
+ end
7
+
4
8
  def cleanup(xmldoc)
5
9
  bcp14_cleanup(xmldoc)
6
10
  abstract_cleanup(xmldoc)
@@ -12,9 +16,8 @@ module Metanorma
12
16
 
13
17
  def boilerplate_isodoc(xmldoc)
14
18
  x = xmldoc.dup
15
- x.root.add_namespace(nil, xml_namespace)
16
- # xml = Nokogiri::XML(x.to_xml)
17
- @isodoc ||= isodoc(@lang, @script, @locale)
19
+ x.root.add_namespace(nil, @conv.xml_namespace)
20
+ @isodoc ||= @conv.isodoc(@lang, @script, @locale)
18
21
  # initialise @isodoc.xrefs, for @isodoc.xrefs.info
19
22
  @isodoc
20
23
  end
@@ -102,6 +105,8 @@ module Metanorma
102
105
  def section_names_refs_cleanup(xml); end
103
106
 
104
107
  def note_cleanup(xmldoc); end
108
+
109
+ def norm_ref_preface(sect, isodoc); end
105
110
  end
106
111
  end
107
112
  end
@@ -1,10 +1,8 @@
1
1
  require "asciidoctor"
2
- require "metanorma/standoc/converter"
2
+ require "metanorma-standoc"
3
3
  require "isodoc/ietf/rfc_convert"
4
4
  require_relative "./front"
5
5
  require_relative "./blocks"
6
- require_relative "./validate"
7
- require_relative "./cleanup"
8
6
  require_relative "./macros"
9
7
 
10
8
  module Metanorma
@@ -31,12 +29,16 @@ module Metanorma
31
29
  super
32
30
  end
33
31
 
32
+ def cache_workgroup(_node)
33
+ Metanorma::Ietf::Data::WORKGROUPS
34
+ end
35
+
34
36
  def outputs(node, ret)
35
37
  File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
36
38
  rfc_converter(node).convert("#{@filename}.xml")
37
39
  end
38
40
 
39
- def init_misc(node)
41
+ def init_metadata(node)
40
42
  super
41
43
  @default_doctype = "internet-draft"
42
44
  end
@@ -121,8 +123,6 @@ module Metanorma
121
123
  [t, rel]
122
124
  end
123
125
 
124
- def norm_ref_preface(sect, isodoc); end
125
-
126
126
  def clause_attrs_preprocess(attrs, node)
127
127
  attrs[:numbered] = node.attr("numbered")
128
128
  attrs[:removeInRFC] = node.attr("removeInRFC")
@@ -179,6 +179,7 @@ module Metanorma
179
179
 
180
180
  def isodoc(lang, script, locale, i18nyaml = nil)
181
181
  conv = rfc_converter(EmptyAttr.new)
182
+ conv.init_i18n({ i18nyaml:, language: lang, script:, locale: })
182
183
  i18n = conv.i18n_init(lang, script, locale, i18nyaml)
183
184
  conv.metadata_init(lang, script, locale, i18n)
184
185
  conv
@@ -167,12 +167,6 @@ Sources are currently only rendered in metanorma-plateau</a:documentation>
167
167
  </define>
168
168
  <define name="DlAttributes">
169
169
  <ref name="BlockAttributes"/>
170
- <optional>
171
- <attribute name="key">
172
- <a:documentation>This definition list is the key of a figure or formula</a:documentation>
173
- <data type="boolean"/>
174
- </attribute>
175
- </optional>
176
170
  </define>
177
171
  <define name="DlBody">
178
172
  <optional>
@@ -311,7 +305,7 @@ and is intended to be referenced by a callout within the source code</a:document
311
305
  </ref>
312
306
  </optional>
313
307
  <choice>
314
- <a:documentation>Content of the figure </a:documentation>
308
+ <a:documentation>Content of the figure</a:documentation>
315
309
  <ref name="image">
316
310
  <a:documentation>by default the content of a figure is a media file</a:documentation>
317
311
  </ref>
@@ -340,8 +334,8 @@ and is intended to be referenced by a callout within the source code</a:document
340
334
  </ref>
341
335
  </zeroOrMore>
342
336
  <optional>
343
- <ref name="dl">
344
- <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
337
+ <ref name="key">
338
+ <a:documentation>An key defining any symbols used in the figure</a:documentation>
345
339
  </ref>
346
340
  </optional>
347
341
  <zeroOrMore>
@@ -365,7 +359,7 @@ and is intended to be referenced by a callout within the source code</a:document
365
359
  </ref>
366
360
  </optional>
367
361
  <choice>
368
- <a:documentation>Content of the figure </a:documentation>
362
+ <a:documentation>Content of the figure</a:documentation>
369
363
  <ref name="image-no-id">
370
364
  <a:documentation>by default the content of a figure is a media file</a:documentation>
371
365
  </ref>
@@ -429,7 +423,7 @@ in order to be applicable in this standardisation document</a:documentation>
429
423
  </element>
430
424
  </define>
431
425
  <define name="sourcecodebody">
432
- <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
426
+ <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
433
427
  (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
434
428
  <element name="body">
435
429
  <oneOrMore>
@@ -549,7 +543,7 @@ normative or informative references, some split references into sections organiz
549
543
  <choice>
550
544
  <a:documentation>Table cell contains a block</a:documentation>
551
545
  <ref name="paragraph-with-footnote"/>
552
- <ref name="dl"/>
546
+ <ref name="key"/>
553
547
  <ref name="ul"/>
554
548
  <ref name="ol"/>
555
549
  <ref name="figure"/>
@@ -632,8 +626,40 @@ This is done if the footnote reference is already presented in some other form,
632
626
  <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
633
627
  </attribute>
634
628
  </define>
629
+ <define name="FormulaBody">
630
+ <ref name="stem">
631
+ <a:documentation>The content of the formula, as a mathematical expression</a:documentation>
632
+ </ref>
633
+ <optional>
634
+ <ref name="key">
635
+ <a:documentation>A key defining any symbols used in the formula</a:documentation>
636
+ </ref>
637
+ </optional>
638
+ <zeroOrMore>
639
+ <ref name="note">
640
+ <a:documentation>Notes whose scope is the current block</a:documentation>
641
+ </ref>
642
+ </zeroOrMore>
643
+ </define>
635
644
  </include>
636
645
  <!-- end overrides -->
646
+ <define name="key">
647
+ <a:documentation>Key to a table, figure, or formula</a:documentation>
648
+ <element name="key">
649
+ <optional>
650
+ <ref name="tname">
651
+ <a:documentation>optional title of key</a:documentation>
652
+ </ref>
653
+ </optional>
654
+ <oneOrMore>
655
+ <choice>
656
+ <a:documentation>Definition list and/or paragraph content</a:documentation>
657
+ <ref name="dl"/>
658
+ <ref name="paragraph"/>
659
+ </choice>
660
+ </oneOrMore>
661
+ </element>
662
+ </define>
637
663
  <define name="TdAttributes" combine="interleave">
638
664
  <ref name="RequiredId"/>
639
665
  <optional>
@@ -1042,7 +1068,7 @@ parargaph sources are currently only rendered in metanorma-plateau</a:documentat
1042
1068
  </optional>
1043
1069
  <optional>
1044
1070
  <attribute name="custom-charset">
1045
- <a:documentation>Character set that the contained text belongs to;
1071
+ <a:documentation>Character set that the contained text belongs to;
1046
1072
  is used in particular to capture mutually agreed definitions of codepoints in Unicode Private Use Area</a:documentation>
1047
1073
  </attribute>
1048
1074
  </optional>
@@ -1623,7 +1649,7 @@ numbers</a:documentation>
1623
1649
  <define name="definitions">
1624
1650
  <a:documentation>One or more definition lists, used to define symbols and abbreviations used in the remainder of the document.
1625
1651
  These can also be used as glossaries, with simple definitions, in contrast to the more elaborate definitions given in
1626
- terms sections </a:documentation>
1652
+ terms sections</a:documentation>
1627
1653
  <element name="definitions">
1628
1654
  <ref name="OptionalId"/>
1629
1655
  <ref name="LocalizedStringAttributes"/>
@@ -1864,7 +1890,7 @@ used in document amendments</a:documentation>
1864
1890
  </zeroOrMore>
1865
1891
  <zeroOrMore>
1866
1892
  <ref name="related">
1867
- <a:documentation>Zero or more names which are related to the term being defined. </a:documentation>
1893
+ <a:documentation>Zero or more names which are related to the term being defined.</a:documentation>
1868
1894
  </ref>
1869
1895
  </zeroOrMore>
1870
1896
  <optional>
@@ -2025,7 +2051,7 @@ used in document amendments</a:documentation>
2025
2051
  <element name="letter-symbol">
2026
2052
  <optional>
2027
2053
  <attribute name="isInternational">
2028
- <a:documentation>Whether the designation is the same across languages, or language-specific </a:documentation>
2054
+ <a:documentation>Whether the designation is the same across languages, or language-specific</a:documentation>
2029
2055
  <data type="boolean"/>
2030
2056
  </attribute>
2031
2057
  </optional>
@@ -2632,6 +2658,11 @@ links within an SVG file, so that the SVG file can hyperlink to anchors within t
2632
2658
  <a:documentation>Connective linking this location to its predecessor. _from/to_ are presumed to nest more closely than _and_ or _or_</a:documentation>
2633
2659
  <ref name="XrefConnectiveType"/>
2634
2660
  </attribute>
2661
+ <optional>
2662
+ <attribute name="custom-connective">
2663
+ <a:documentation>Custom wording for connnective linking this location to its predecessor, custom wording. If provided, is treated as equivalent semantically to connective value</a:documentation>
2664
+ </attribute>
2665
+ </optional>
2635
2666
  </element>
2636
2667
  </define>
2637
2668
  <define name="XrefStyleType">
@@ -2658,6 +2689,11 @@ links within an SVG file, so that the SVG file can hyperlink to anchors within t
2658
2689
  <ref name="XrefConnectiveType"/>
2659
2690
  </attribute>
2660
2691
  </optional>
2692
+ <optional>
2693
+ <attribute name="custom-connective">
2694
+ <a:documentation>Custom wording for connnective linking this location to its predecessor, custom wording. If provided, is treated as equivalent semantically to connective value</a:documentation>
2695
+ </attribute>
2696
+ </optional>
2661
2697
  <ref name="erefType"/>
2662
2698
  </define>
2663
2699
  <define name="erefstack">
@@ -3,7 +3,11 @@ require "metanorma-utils"
3
3
 
4
4
  module Metanorma
5
5
  module Ietf
6
- class Converter < ::Metanorma::Standoc::Converter
6
+ class Validate < ::Metanorma::Standoc::Validate
7
+ def copied_instance_variables
8
+ super + %i[workgroups]
9
+ end
10
+
7
11
  def content_validate(doc)
8
12
  super
9
13
  image_validate(doc)
@@ -42,10 +46,6 @@ module Metanorma
42
46
  def schema_file
43
47
  "ietf.rng"
44
48
  end
45
-
46
- def cache_workgroup(_node)
47
- Metanorma::Ietf::Data::WORKGROUPS
48
- end
49
49
  end
50
50
  end
51
51
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.6.8".freeze
3
+ VERSION = "3.7.1".freeze
4
4
  end
5
5
  end
@@ -4,6 +4,8 @@ require "vectory"
4
4
 
5
5
  require_relative "metanorma/ietf"
6
6
  require_relative "metanorma/ietf/converter"
7
+ require_relative "metanorma/ietf/cleanup"
8
+ require_relative "metanorma/ietf/validate"
7
9
  require_relative "isodoc/ietf/rfc_convert"
8
10
 
9
11
  Metanorma::Registry.instance.register(Metanorma::Ietf::Processor)
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
38
38
 
39
39
  spec.add_dependency "metanorma-ietf-data"
40
- spec.add_dependency "metanorma-standoc", "~> 3.2.0"
40
+ spec.add_dependency "metanorma-standoc", "~> 3.3.1"
41
41
  spec.add_dependency "relaton-render"
42
42
 
43
43
  spec.add_development_dependency "debug"
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.6.8
4
+ version: 3.7.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-12-01 00:00:00.000000000 Z
11
+ date: 2026-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-ietf-data
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.0
33
+ version: 3.3.1
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: 3.2.0
40
+ version: 3.3.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-render
43
43
  requirement: !ruby/object:Gem::Requirement