metanorma-ietf 3.3.1 → 3.3.3

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: bb82c80628bb536b66d81ab800e691b8ba7418613d0e3674b62f7484c2187028
4
- data.tar.gz: 6e9756870cdc1fa2c030fc96ee568da30029337a9391262753b43b5dcb84f477
3
+ metadata.gz: bd5aabcc61900b281a88f27e9f535dcde55d76b8e9174842aea66a6647017eeb
4
+ data.tar.gz: 62b22962648168f94376adef64df8495a54d385039f59482f239a5279e70cc92
5
5
  SHA512:
6
- metadata.gz: 5045596c0a83e68133982e66d2bb906fb70aa17f54443bdfcaea250465014d6b7239ce21b3266bc772ce5da7b74840791b031b1b9faedf46c014644d4b792550
7
- data.tar.gz: 06c35297096cd876d320a625737a9243d093752415e2fa6d4f3a2e83c09c79e51279b62ddbcc36e09cf818bc1195ef41201c4b69dd573a8b31c8de4512642abf
6
+ metadata.gz: a29ebeffd4659064b921b8ee271b78b7588a9412aafa2274b043f7cca448ee467200c5897338d95a33999e0ef203b9b6614374aa302ebfa1bf32f816d976d1e5
7
+ data.tar.gz: 2506fb85aa36bba3ef0309e6276b74395303e52086faa4ee0f4badd40e5488f931e2eb60528e0c4750c0d74c3fd24a87d16825f5800abdf27c992da034d57b59
@@ -54,7 +54,7 @@ module IsoDoc
54
54
  def ietf_bibitem(list, bib, _ordinal)
55
55
  uris = bib.xpath(ns("./uri"))
56
56
  target = nil
57
- uris&.each { |u| target = u.text if u["type"] == "src" }
57
+ uris&.each { |u| target = u.text if %w(src HTML).include?(u["type"]) }
58
58
  list.reference **attr_code(target: target,
59
59
  anchor: bib["id"]) do |r|
60
60
  bibitem_render(r, bib)
@@ -338,29 +338,32 @@
338
338
  </define>
339
339
  <define name="organization">
340
340
  <element name="organization">
341
- <oneOrMore>
342
- <ref name="orgname"/>
343
- </oneOrMore>
344
- <zeroOrMore>
345
- <ref name="subdivision"/>
346
- </zeroOrMore>
347
- <optional>
348
- <ref name="abbreviation"/>
349
- </optional>
350
- <zeroOrMore>
351
- <ref name="uri"/>
352
- </zeroOrMore>
353
- <zeroOrMore>
354
- <ref name="org-identifier"/>
355
- </zeroOrMore>
356
- <zeroOrMore>
357
- <ref name="contact"/>
358
- </zeroOrMore>
359
- <optional>
360
- <ref name="logo"/>
361
- </optional>
341
+ <ref name="OrganizationType"/>
362
342
  </element>
363
343
  </define>
344
+ <define name="OrganizationType">
345
+ <oneOrMore>
346
+ <ref name="orgname"/>
347
+ </oneOrMore>
348
+ <zeroOrMore>
349
+ <ref name="subdivision"/>
350
+ </zeroOrMore>
351
+ <optional>
352
+ <ref name="abbreviation"/>
353
+ </optional>
354
+ <zeroOrMore>
355
+ <ref name="uri"/>
356
+ </zeroOrMore>
357
+ <zeroOrMore>
358
+ <ref name="org-identifier"/>
359
+ </zeroOrMore>
360
+ <zeroOrMore>
361
+ <ref name="contact"/>
362
+ </zeroOrMore>
363
+ <optional>
364
+ <ref name="logo"/>
365
+ </optional>
366
+ </define>
364
367
  <define name="orgname">
365
368
  <element name="name">
366
369
  <choice>
@@ -371,10 +374,10 @@
371
374
  </define>
372
375
  <define name="subdivision">
373
376
  <element name="subdivision">
374
- <choice>
375
- <ref name="LocalizedString"/>
376
- <ref name="NameWithVariants"/>
377
- </choice>
377
+ <optional>
378
+ <attribute name="type"/>
379
+ </optional>
380
+ <ref name="OrganizationType"/>
378
381
  </element>
379
382
  </define>
380
383
  <define name="logo">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.3.1".freeze
3
+ VERSION = "3.3.3".freeze
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@ template:
20
20
  # skip standardidentifier, it is inserted in front of formattedref within metanorma
21
21
  # date is cleaned up into RFC XML formatting afterwards
22
22
  # ref-included is cleaned up as referencegroup/reference in RFC XML afterwards
23
- standard: "{% if stream %}<stream>{{stream}}</stream>{% endif %} <front> <title>{{ title }}</title> {{ creatornames }} <date_cleanme='true'>{{date}}</date> {% for k in keywords %}<keyword>{{k}}</keyword>{%endfor%} <abstract_cleanme='true'>{{abstract}}</abstract> </front> {% for u in uris %}<format_target='{{u.content}}'_type='{%if u.type%}{{u.type}}{%else%}HTML{%endif%}'/>{% endfor %} {{ series }} {%for d in doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | strip }}'_name='DOI'/>{% endfor %} {% if home_standard %}{% for j in authoritative_identifier %} <seriesInfo_value='{{ j | replace: ' ', ' ' | strip | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if j contains 'I-D.'%}Internet-Draft{% else %}{{ j | replace: ' ', ' ' | strip | split: ' ' | slice: -2 }}{%endif%}'/> {% endfor %} {% else %} <refcontent>{{authoritative_identifier | join: ', '}}</refcontent> {% endif %} {% for i in included %}<ref-included> {% if i.stream %}<stream>{{i.stream}}</stream>{% endif %} <front> <title>{% if i.title %}{{ i.title}}{%else%}[TITLE]{%endif%}</title> {% if i.creatornames %}{{ i.creatornames }}{%else%}<author></author>{%endif%} <date_cleanme='true'>{{i.date}}</date> {% for k in i.keywords %}<keyword>{{k}}</keyword>{%endfor%} <abstract_cleanme='true'>{{i.abstract}}</abstract> </front> {% for u in i.uris %}<format_target='{{u.content}}'_type='{%if u.type%}{{u.type}}{%else%}HTML{%endif%}'/>{% endfor %} {{ series }} {%for d in i.doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | strip }}'_name='DOI'/>{% endfor %} {% if home_standard %}{% for j in i.authoritative_identifier %} <seriesInfo_value='{{ j | replace: ' ', ' ' | strip | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if j contains 'I-D.'%}Internet-Draft{% else %}{{ j | replace: ' ', ' ' | strip | split: ' ' | slice: -2 }}{%endif%}'/> {% endfor %} {% else %} <refcontent>{{i.authoritative_identifier | join: ', '}}</refcontent> {% endif %}</ref-included>{% endfor %}"
23
+ standard: "{% if stream %}<stream>{{stream}}</stream>{% endif %} <front> <title>{{ title }}</title> {{ creatornames }} <date_cleanme='true'>{{date}}</date> {% for k in keywords %}<keyword>{{k}}</keyword>{%endfor%} <abstract_cleanme='true'>{{abstract}}</abstract> </front> {% for u in uris %}<format_target='{{u.content}}'_type='{%if u.type%}{{u.type}}{%else%}HTML{%endif%}'/>{% endfor %} {{ series }} {%for d in doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | strip }}'_name='DOI'/>{% endfor %} {% if home_standard %}{% for j in authoritative_identifier %} <seriesInfo_value='{{ j | replace: ' ', ' ' | strip | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if j contains 'I-D.'%}Internet-Draft{% else %}{{ j | replace: ' ', ' ' | strip | split: ' ' | slice: -2 }}{%endif%}'/> {% endfor %} {% else %} <refcontent>{{authoritative_identifier | join: ', '}}</refcontent> {% endif %} {% for i in included %}<ref-included target='{{ i.uris[0].content }}'> {% if i.stream %}<stream>{{i.stream}}</stream>{% endif %} <front> <title>{% if i.title %}{{ i.title}}{%else%}[TITLE]{%endif%}</title> {% if i.creatornames %}{{ i.creatornames }}{%else%}<author></author>{%endif%} <date_cleanme='true'>{{i.date}}</date> {% for k in i.keywords %}<keyword>{{k}}</keyword>{%endfor%} <abstract_cleanme='true'>{{i.abstract}}</abstract> </front> {% for u in i.uris %}<format_target='{{u.content}}'_type='{%if u.type%}{{u.type}}{%else%}HTML{%endif%}'/>{% endfor %} {{ series }} {%for d in i.doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | strip }}'_name='DOI'/>{% endfor %} {% if home_standard %}{% for j in i.authoritative_identifier %} <seriesInfo_value='{{ j | replace: ' ', ' ' | strip | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if j contains 'I-D.'%}Internet-Draft{% else %}{{ j | replace: ' ', ' ' | strip | split: ' ' | slice: -2 }}{%endif%}'/> {% endfor %} {% else %} <refcontent>{{i.authoritative_identifier | join: ', '}}</refcontent> {% endif %}</ref-included>{% endfor %}"
24
24
  website: standard
25
25
  book: standard
26
26
  booklet: standard
@@ -20,6 +20,14 @@ module Relaton
20
20
  date.nil? and return nil
21
21
  date_range(date)
22
22
  end
23
+
24
+ def compound_fields_format(hash)
25
+ ret = super
26
+ ret[:included]&.each do |h|
27
+ compound_fields_format(h)
28
+ end
29
+ ret
30
+ end
23
31
  end
24
32
  end
25
33
  end
@@ -2,6 +2,11 @@ module Relaton
2
2
  module Render
3
3
  module Ietf
4
4
  class Parse < ::Relaton::Render::Parse
5
+ def initialize(options)
6
+ super
7
+ @fieldsklass = Relaton::Render::Ietf::Fields
8
+ end
9
+
5
10
  def simple_or_host_xml2hash(doc, host)
6
11
  ret = super
7
12
  ret.merge(home_standard: home_standard(doc, ret[:publisher_raw]),
@@ -88,12 +93,12 @@ module Relaton
88
93
  super
89
94
  end
90
95
 
91
- # do not add BCP number, it is not included in IETF practice
92
96
  def authoritative_identifier(doc)
93
97
  ret = super
94
- #if bcp = doc.series.detect { |s| s.title.title.content == "BCP" }
95
- #ret.unshift("BCP #{bcp.number}")
96
- #end
98
+ bcp = doc.series.detect do |s|
99
+ %w(BCP STD).include?(s.title.title.content)
100
+ end
101
+ bcp and ret.unshift("BCP #{bcp.number}")
97
102
  ret.reject { |x| /^(rfc-anchor|Internet-Draft)/.match? (x) }
98
103
  end
99
104
 
@@ -118,17 +123,18 @@ module Relaton
118
123
  end
119
124
 
120
125
  def included_xml2hash(doc)
121
- r = doc.relation.select { |x| x.type == "includes" }
122
- .map { |x| parse_single_bibitem(x.bibitem) }
126
+ r = doc.relation.select { |x| x.type == "includes" }.map do |x|
127
+ parse_single_bibitem(x.bibitem)
128
+ end
123
129
  r.empty? and return {}
124
130
  { included: r }
125
131
  end
126
132
 
127
133
  def parse_single_bibitem(doc)
128
- data = extract(doc)
129
- #enhance_data(data, r.template_raw)
130
- #data_liquid = @fieldsklass.new(renderer: self)
131
- # .compound_fields_format(data)
134
+ data = extract(doc)
135
+ # enhance_data(data, r.template_raw)
136
+ # data_liquid = @fieldsklass.new(renderer: self)
137
+ # .compound_fields_format(data)
132
138
  end
133
139
  end
134
140
  end
@@ -37,9 +37,8 @@ Gem::Specification.new do |spec|
37
37
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
38
38
 
39
39
  spec.add_dependency "metanorma-ietf-data"
40
- spec.add_dependency "metanorma-standoc", "~> 2.8.0"
40
+ spec.add_dependency "metanorma-standoc", "~> 2.8.4"
41
41
  spec.add_dependency "relaton-render"
42
- spec.add_dependency "vectory", "~> 0.6"
43
42
 
44
43
  spec.add_development_dependency "debug"
45
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.3.1
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-05 00:00:00.000000000 Z
11
+ date: 2024-03-04 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: 2.8.0
33
+ version: 2.8.4
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: 2.8.0
40
+ version: 2.8.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-render
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: vectory
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.6'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.6'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: debug
71
57
  requirement: !ruby/object:Gem::Requirement