metanorma-ietf 3.0.6 → 3.0.9

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: b48379093e4f20d35fddb174f623ff1e926c2ae65b6e473df2476d7cfd203b0b
4
- data.tar.gz: 640976bed48e7c8b9c4ac56533059a240a93c8bc814473456b8034dc1ffdb777
3
+ metadata.gz: bdae18146fd717cdc3e4edbc6aee7c51e286e93f4f04b08f247d0110c29644d5
4
+ data.tar.gz: 5990873706f6bab2c18005eba348edc987b54a7600c62889def4579c5f82b622
5
5
  SHA512:
6
- metadata.gz: e27578363727679af9e4c75865bf7a82caa39050fbd0e6f76c15e38ca6a24af2c492d8e127b376048d6ae2e65d3924ff6e583fcc0fe2eed9a41b2ae0b82d5fc3
7
- data.tar.gz: 74c40963d020da82e6e9c7c05b8d723f3724d4dd69c293bfd1d0a5251733f077a975f10cbe440561cfb6d9443fb2c78ce92a8792d67835c8c182168d098bca13
6
+ metadata.gz: 8aed3ba6d2fe6b46f5907b71feefc20fe49bcc73c6a68244855eb730dae27c552347e4a3c3ec8f77d190f04f7e8f25560c5cd4d0b4ce00572dead34bdd7674c0
7
+ data.tar.gz: 854ab1d486f0689509468ec3f3342b38894e27b146abe258bb09d544e2dc8f9df65b1828b64d44589cab485ad09ad71b51859b164e0051599e0be6c6fea84b8c
@@ -7,7 +7,7 @@ module IsoDoc
7
7
  else
8
8
  YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
9
9
  end
10
- super.merge(y)
10
+ super.deep_merge(y)
11
11
  end
12
12
  end
13
13
  end
@@ -38,7 +38,6 @@ module IsoDoc
38
38
 
39
39
  i += 1 if b.name == "bibitem"
40
40
  if b.name == "note" then note_parse(b, div)
41
- elsif ietf?(b) then ietf_bibitem_entry(div, b, i)
42
41
  else
43
42
  nonstd_bibitem(div, b, i, biblio)
44
43
  end
@@ -171,18 +170,6 @@ module IsoDoc
171
170
  end
172
171
  end
173
172
  end
174
-
175
- def ietf_bibitem_entry(div, bib, _idx)
176
- url = bib&.at(ns("./uri[@type = 'xml']"))&.text
177
- div << "<xi:include href='#{url}'/>"
178
- end
179
-
180
- def ietf?(bib)
181
- return false if !@xinclude
182
-
183
- url = bib.at(ns("./uri[@type = 'xml']")) or return false
184
- /xml2rfc\.tools\.ietf\.org/.match(url)
185
- end
186
173
  end
187
174
  end
188
175
  end
@@ -2,7 +2,7 @@ module IsoDoc
2
2
  module Ietf
3
3
  class RfcConvert < ::IsoDoc::Convert
4
4
  def recommendation_labels(node)
5
- [node.at(ns("./label")), node.at(ns("./title")),
5
+ [node.at(ns("./identifier")), node.at(ns("./title")),
6
6
  @xrefs.anchor(node["id"], :label, false)]
7
7
  end
8
8
 
@@ -37,7 +37,7 @@ module IsoDoc
37
37
  recommendation_name(node, out, @i18n.recommendation)
38
38
  recommendation_attributes(node, out)
39
39
  node.children.each do |n|
40
- parse(n, out) unless %w(label title).include? n.name
40
+ parse(n, out) unless %w(identifier title).include? n.name
41
41
  end
42
42
  end
43
43
 
@@ -45,7 +45,7 @@ module IsoDoc
45
45
  recommendation_name(node, out, @i18n.requirement)
46
46
  recommendation_attributes(node, out)
47
47
  node.children.each do |n|
48
- parse(n, out) unless %w(label title).include? n.name
48
+ parse(n, out) unless %w(identifier title).include? n.name
49
49
  end
50
50
  end
51
51
 
@@ -53,7 +53,7 @@ module IsoDoc
53
53
  recommendation_name(node, out, @i18n.permission)
54
54
  recommendation_attributes(node, out)
55
55
  node.children.each do |n|
56
- parse(n, out) unless %w(label title).include? n.name
56
+ parse(n, out) unless %w(identifier title).include? n.name
57
57
  end
58
58
  end
59
59
 
@@ -614,12 +614,103 @@
614
614
  <optional>
615
615
  <ref name="fetched"/>
616
616
  </optional>
617
- <choice>
618
- <oneOrMore>
619
- <ref name="btitle"/>
620
- </oneOrMore>
617
+ <optional>
621
618
  <ref name="formattedref"/>
622
- </choice>
619
+ </optional>
620
+ <oneOrMore>
621
+ <ref name="btitle"/>
622
+ </oneOrMore>
623
+ <zeroOrMore>
624
+ <ref name="bsource"/>
625
+ </zeroOrMore>
626
+ <oneOrMore>
627
+ <ref name="docidentifier"/>
628
+ </oneOrMore>
629
+ <optional>
630
+ <ref name="docnumber"/>
631
+ </optional>
632
+ <zeroOrMore>
633
+ <ref name="bdate"/>
634
+ </zeroOrMore>
635
+ <zeroOrMore>
636
+ <ref name="contributor"/>
637
+ </zeroOrMore>
638
+ <optional>
639
+ <ref name="edition"/>
640
+ </optional>
641
+ <zeroOrMore>
642
+ <ref name="version"/>
643
+ </zeroOrMore>
644
+ <zeroOrMore>
645
+ <ref name="biblionote"/>
646
+ </zeroOrMore>
647
+ <zeroOrMore>
648
+ <ref name="language"/>
649
+ </zeroOrMore>
650
+ <zeroOrMore>
651
+ <ref name="script"/>
652
+ </zeroOrMore>
653
+ <zeroOrMore>
654
+ <ref name="bibabstract"/>
655
+ </zeroOrMore>
656
+ <optional>
657
+ <ref name="status"/>
658
+ </optional>
659
+ <zeroOrMore>
660
+ <ref name="copyright"/>
661
+ </zeroOrMore>
662
+ <zeroOrMore>
663
+ <ref name="docrelation"/>
664
+ </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="series"/>
667
+ </zeroOrMore>
668
+ <optional>
669
+ <ref name="medium"/>
670
+ </optional>
671
+ <zeroOrMore>
672
+ <ref name="bplace"/>
673
+ </zeroOrMore>
674
+ <zeroOrMore>
675
+ <ref name="bprice"/>
676
+ </zeroOrMore>
677
+ <zeroOrMore>
678
+ <ref name="extent"/>
679
+ </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
683
+ <zeroOrMore>
684
+ <ref name="accesslocation"/>
685
+ </zeroOrMore>
686
+ <zeroOrMore>
687
+ <ref name="license"/>
688
+ </zeroOrMore>
689
+ <zeroOrMore>
690
+ <ref name="bclassification"/>
691
+ </zeroOrMore>
692
+ <zeroOrMore>
693
+ <ref name="bkeyword"/>
694
+ </zeroOrMore>
695
+ <optional>
696
+ <ref name="validity"/>
697
+ </optional>
698
+ </define>
699
+ <define name="ReducedBibliographicItem">
700
+ <optional>
701
+ <attribute name="type">
702
+ <ref name="BibItemType"/>
703
+ </attribute>
704
+ </optional>
705
+ <optional>
706
+ <ref name="fetched"/>
707
+ </optional>
708
+ <optional>
709
+ <ref name="formattedref"/>
710
+ </optional>
711
+ <zeroOrMore>
712
+ <ref name="btitle"/>
713
+ </zeroOrMore>
623
714
  <zeroOrMore>
624
715
  <ref name="bsource"/>
625
716
  </zeroOrMore>
@@ -638,9 +729,9 @@
638
729
  <optional>
639
730
  <ref name="edition"/>
640
731
  </optional>
641
- <optional>
732
+ <zeroOrMore>
642
733
  <ref name="version"/>
643
- </optional>
734
+ </zeroOrMore>
644
735
  <zeroOrMore>
645
736
  <ref name="biblionote"/>
646
737
  </zeroOrMore>
@@ -833,6 +924,12 @@
833
924
  <data type="boolean"/>
834
925
  </attribute>
835
926
  </optional>
927
+ <optional>
928
+ <attribute name="language"/>
929
+ </optional>
930
+ <optional>
931
+ <attribute name="script"/>
932
+ </optional>
836
933
  <text/>
837
934
  </element>
838
935
  </define>
@@ -986,36 +1083,34 @@
986
1083
  <ref name="SeriesType"/>
987
1084
  </attribute>
988
1085
  </optional>
989
- <choice>
1086
+ <optional>
990
1087
  <ref name="formattedref"/>
991
- <group>
992
- <ref name="btitle"/>
993
- <optional>
994
- <ref name="bplace"/>
995
- </optional>
996
- <optional>
997
- <ref name="seriesorganization"/>
998
- </optional>
999
- <optional>
1000
- <ref name="abbreviation"/>
1001
- </optional>
1002
- <optional>
1003
- <ref name="seriesfrom"/>
1004
- </optional>
1005
- <optional>
1006
- <ref name="seriesto"/>
1007
- </optional>
1008
- <optional>
1009
- <ref name="seriesnumber"/>
1010
- </optional>
1011
- <optional>
1012
- <ref name="seriespartnumber"/>
1013
- </optional>
1014
- <optional>
1015
- <ref name="seriesrun"/>
1016
- </optional>
1017
- </group>
1018
- </choice>
1088
+ </optional>
1089
+ <ref name="btitle"/>
1090
+ <optional>
1091
+ <ref name="bplace"/>
1092
+ </optional>
1093
+ <optional>
1094
+ <ref name="seriesorganization"/>
1095
+ </optional>
1096
+ <optional>
1097
+ <ref name="abbreviation"/>
1098
+ </optional>
1099
+ <optional>
1100
+ <ref name="seriesfrom"/>
1101
+ </optional>
1102
+ <optional>
1103
+ <ref name="seriesto"/>
1104
+ </optional>
1105
+ <optional>
1106
+ <ref name="seriesnumber"/>
1107
+ </optional>
1108
+ <optional>
1109
+ <ref name="seriespartnumber"/>
1110
+ </optional>
1111
+ <optional>
1112
+ <ref name="seriesrun"/>
1113
+ </optional>
1019
1114
  </element>
1020
1115
  </define>
1021
1116
  <define name="SeriesType">
@@ -1174,7 +1269,7 @@
1174
1269
  </element>
1175
1270
  </optional>
1176
1271
  <element name="bibitem">
1177
- <ref name="BibliographicItem"/>
1272
+ <ref name="ReducedBibliographicItem"/>
1178
1273
  </element>
1179
1274
  <choice>
1180
1275
  <zeroOrMore>
@@ -1199,9 +1294,9 @@
1199
1294
  <optional>
1200
1295
  <ref name="revision-date"/>
1201
1296
  </optional>
1202
- <zeroOrMore>
1297
+ <optional>
1203
1298
  <ref name="draft"/>
1204
- </zeroOrMore>
1299
+ </optional>
1205
1300
  </element>
1206
1301
  </define>
1207
1302
  <define name="vedition">
@@ -2,10 +2,10 @@ module Metanorma
2
2
  module Ietf
3
3
  class Converter < ::Metanorma::Standoc::Converter
4
4
  def para_attrs(node)
5
- attr_code( "keep-with-next": node.attr("keepWithNext") ||
5
+ attr_code("keep-with-next": node.attr("keepWithNext") ||
6
6
  node.attr("keep-with-next"),
7
7
  "keep-with-previous": node.attr("keepWithPrevious") ||
8
- node.attr("keep-with-previous"),
8
+ node.attr("keep-with-previous"),
9
9
  id: ::Metanorma::Utils::anchor_or_uuid(node))
10
10
  end
11
11
 
@@ -36,20 +36,21 @@ module Metanorma
36
36
 
37
37
  def sidebar(node)
38
38
  return unless draft?
39
+
39
40
  noko do |xml|
40
- xml.review **(sidebar_attrs(node)) do |r|
41
+ xml.review **sidebar_attrs(node) do |r|
41
42
  node.title.nil? or r.name { |name| name << node.title }
42
43
  wrap_in_para(node, r)
43
44
  end
44
45
  end
45
46
  end
46
47
 
47
- def note(n)
48
+ def note(node)
48
49
  noko do |xml|
49
- xml.note **attr_code(id: ::Metanorma::Utils::anchor_or_uuid(n),
50
- removeInRFC: n.attr("remove-in-rfc")) do |c|
51
- n.title.nil? or c.name { |name| name << n.title }
52
- wrap_in_para(n, c)
50
+ xml.note **attr_code(id: ::Metanorma::Utils::anchor_or_uuid(nil),
51
+ removeInRFC: node.attr("remove-in-rfc")) do |c|
52
+ node.title.nil? or c.name { |name| name << node.title }
53
+ wrap_in_para(node, c)
53
54
  end
54
55
  end.join("\n")
55
56
  end
@@ -59,9 +60,9 @@ module Metanorma
59
60
  xml.figure **literal_attrs(node) do |f|
60
61
  figure_title(node, f)
61
62
  f.pre node.lines.join("\n"),
62
- **attr_code(align: node.attr("align"),
63
- id: ::Metanorma::Utils::anchor_or_uuid(nil),
64
- alt: node.attr("alt"))
63
+ **attr_code(align: node.attr("align"),
64
+ id: ::Metanorma::Utils::anchor_or_uuid(nil),
65
+ alt: node.attr("alt"))
65
66
  end
66
67
  end
67
68
  end
@@ -70,9 +71,10 @@ module Metanorma
70
71
  super.merge(attr_code(align: node.attr("align")))
71
72
  end
72
73
 
73
- def listing_attrs(node)
74
- super.merge(attr_code(markers: node.attr("markers"), src: node.attr("src")))
75
- end
74
+ def listing_attrs(node)
75
+ super.merge(attr_code(markers: node.attr("markers"),
76
+ src: node.attr("src")))
77
+ end
76
78
  end
77
79
  end
78
80
  end
@@ -5,7 +5,6 @@ module Metanorma
5
5
  bcp14_cleanup(xmldoc)
6
6
  abstract_cleanup(xmldoc)
7
7
  super
8
- rfc_anchor_cleanup(xmldoc)
9
8
  cref_cleanup(xmldoc)
10
9
  xmldoc
11
10
  end
@@ -42,21 +41,6 @@ module Metanorma
42
41
  end
43
42
  end
44
43
 
45
- def rfc_anchor_cleanup(xml)
46
- map = xml.xpath("//bibitem[docidentifier[@type = 'IETF' or @type = 'RFC']"\
47
- "[@scope = 'anchor']]").each_with_object({}) do |b, m|
48
- next if b.at("./ancestor::bibdata | ./ancestor::bibitem")
49
-
50
- id = b.at("./docidentifier[@type = 'IETF' or @type = 'RFC'][@scope = 'anchor']").text
51
- m[b["id"]] = id
52
- b["id"] = id
53
- end
54
- xml.xpath("//eref | //origin").each do |x|
55
- map[x["bibitemid"]] and x["bibitemid"] = map[x["bibitemid"]]
56
- end
57
- xml
58
- end
59
-
60
44
  def smartquotes_cleanup(xmldoc)
61
45
  xmldoc.traverse do |n|
62
46
  next unless n.text?
@@ -38,7 +38,7 @@ module Metanorma
38
38
  end
39
39
 
40
40
  def doctype(node)
41
- ret = super
41
+ ret = node.attr("doctype")&.gsub(/\s+/, "-")&.downcase || "internet-draft"
42
42
  ret = "internet-draft" if ret == "article"
43
43
  ret
44
44
  end
@@ -69,6 +69,17 @@
69
69
  </zeroOrMore>
70
70
  </element>
71
71
  </define>
72
+ <define name="AdmonitionType">
73
+ <choice>
74
+ <value>warning</value>
75
+ <value>note</value>
76
+ <value>tip</value>
77
+ <value>important</value>
78
+ <value>caution</value>
79
+ <value>statement</value>
80
+ <value>editorial</value>
81
+ </choice>
82
+ </define>
72
83
  <define name="index">
73
84
  <element name="index">
74
85
  <optional>
@@ -116,6 +127,11 @@
116
127
  <data type="boolean"/>
117
128
  </attribute>
118
129
  </optional>
130
+ <optional>
131
+ <attribute name="suppress_identifier">
132
+ <data type="boolean"/>
133
+ </attribute>
134
+ </optional>
119
135
  <ref name="BibliographicItem"/>
120
136
  </element>
121
137
  </define>
@@ -282,6 +298,9 @@
282
298
  <ref name="MultilingualRenderingType"/>
283
299
  </attribute>
284
300
  </optional>
301
+ <optional>
302
+ <ref name="tname"/>
303
+ </optional>
285
304
  <oneOrMore>
286
305
  <ref name="ul_li"/>
287
306
  </oneOrMore>
@@ -324,6 +343,9 @@
324
343
  </choice>
325
344
  </attribute>
326
345
  </optional>
346
+ <optional>
347
+ <ref name="tname"/>
348
+ </optional>
327
349
  <oneOrMore>
328
350
  <ref name="li"/>
329
351
  </oneOrMore>
@@ -360,6 +382,9 @@
360
382
  <ref name="MultilingualRenderingType"/>
361
383
  </attribute>
362
384
  </optional>
385
+ <optional>
386
+ <ref name="tname"/>
387
+ </optional>
363
388
  <oneOrMore>
364
389
  <ref name="dt"/>
365
390
  <ref name="dd"/>
@@ -694,6 +719,9 @@
694
719
  <optional>
695
720
  <attribute name="tag"/>
696
721
  </optional>
722
+ <optional>
723
+ <attribute name="type"/>
724
+ </optional>
697
725
  <optional>
698
726
  <attribute name="multilingual-rendering">
699
727
  <ref name="MultilingualRenderingType"/>
@@ -729,6 +757,9 @@
729
757
  <optional>
730
758
  <attribute name="tag"/>
731
759
  </optional>
760
+ <optional>
761
+ <attribute name="type"/>
762
+ </optional>
732
763
  <optional>
733
764
  <attribute name="multilingual-rendering">
734
765
  <ref name="MultilingualRenderingType"/>
@@ -1254,7 +1285,12 @@
1254
1285
  </define>
1255
1286
  <define name="span">
1256
1287
  <element name="span">
1257
- <attribute name="class"/>
1288
+ <optional>
1289
+ <attribute name="class"/>
1290
+ </optional>
1291
+ <optional>
1292
+ <attribute name="style"/>
1293
+ </optional>
1258
1294
  <oneOrMore>
1259
1295
  <ref name="TextElement"/>
1260
1296
  </oneOrMore>
@@ -2050,6 +2086,7 @@
2050
2086
  <value>compare</value>
2051
2087
  <value>contrast</value>
2052
2088
  <value>see</value>
2089
+ <value>seealso</value>
2053
2090
  </choice>
2054
2091
  </define>
2055
2092
  <define name="deprecates">
@@ -2472,6 +2509,16 @@
2472
2509
  <text/>
2473
2510
  </element>
2474
2511
  </optional>
2512
+ <optional>
2513
+ <element name="amendment">
2514
+ <text/>
2515
+ </element>
2516
+ </optional>
2517
+ <optional>
2518
+ <element name="corrigendum">
2519
+ <text/>
2520
+ </element>
2521
+ </optional>
2475
2522
  <optional>
2476
2523
  <element name="language">
2477
2524
  <text/>
@@ -108,7 +108,7 @@
108
108
  </element>
109
109
  </define>
110
110
  <define name="label">
111
- <element name="label">
111
+ <element name="identifier">
112
112
  <oneOrMore>
113
113
  <ref name="TextElement"/>
114
114
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.0.6".freeze
3
+ VERSION = "3.0.9".freeze
4
4
  end
5
5
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.add_dependency "mathml2asciimath"
39
39
  spec.add_dependency "metanorma-ietf-data"
40
- spec.add_dependency "metanorma-standoc", "~> 2.1.0"
40
+ spec.add_dependency "metanorma-standoc", "~> 2.2.0"
41
41
 
42
42
  spec.add_development_dependency "debug"
43
43
  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.6
4
+ version: 3.0.9
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-05-09 00:00:00.000000000 Z
11
+ date: 2022-08-08 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.1.0
47
+ version: 2.2.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.1.0
54
+ version: 2.2.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: debug
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -235,9 +235,6 @@ files:
235
235
  - LICENSE
236
236
  - README.adoc
237
237
  - Rakefile
238
- - docs/installation.md
239
- - docs/navigation.md
240
- - docs/overview.md
241
238
  - lib/isodoc/ietf/SVG-1.2-RFC.rng
242
239
  - lib/isodoc/ietf/blocks.rb
243
240
  - lib/isodoc/ietf/cleanup.rb
@@ -296,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
293
  - !ruby/object:Gem::Version
297
294
  version: '0'
298
295
  requirements: []
299
- rubygems_version: 3.3.9
296
+ rubygems_version: 3.3.16
300
297
  signing_key:
301
298
  specification_version: 4
302
299
  summary: metanorma-ietf lets you write IETF documents, such as Internet-Drafts and
data/docs/installation.md DELETED
@@ -1,21 +0,0 @@
1
- ---
2
- title: Installation
3
- ---
4
-
5
- Add this line to your application’s Gemfile:
6
-
7
- ```
8
- gem "metanorma-ietf"
9
- ```
10
-
11
- And then execute:
12
-
13
- ```
14
- $ bundle
15
- ```
16
-
17
- Or install it yourself as:
18
-
19
- ```
20
- $ gem install metanorma-cli
21
- ```
data/docs/navigation.md DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- items:
3
- - title: Introduction
4
- items:
5
- - { title: Overview, path: overview/ }
6
- - { title: Installation, path: installation/ }
7
- ---
data/docs/overview.md DELETED
@@ -1,5 +0,0 @@
1
- ---
2
- title: Overview
3
- ---
4
-
5
- metanorma-ietf lets you write Internet-Drafts and RFCs using the Metanorma publishing toolchain.