metanorma-ietf 3.3.1 → 3.3.2

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: 14265a284f4144c71da7f1e427b520cc6d0e34fe888cb368d0f05423fbbf7958
4
+ data.tar.gz: b4a6341006304c7bc49b73f12486dc54bf4e7bddee10a87ec16eff99832db7eb
5
5
  SHA512:
6
- metadata.gz: 5045596c0a83e68133982e66d2bb906fb70aa17f54443bdfcaea250465014d6b7239ce21b3266bc772ce5da7b74840791b031b1b9faedf46c014644d4b792550
7
- data.tar.gz: 06c35297096cd876d320a625737a9243d093752415e2fa6d4f3a2e83c09c79e51279b62ddbcc36e09cf818bc1195ef41201c4b69dd573a8b31c8de4512642abf
6
+ metadata.gz: 4f980c68587bf34737ffe6c3117ed76ba6fc4a0b0db662dd75bf93d36ab19b82d0b1599f0179970da8e20d55afc72ad793d3f0c768a90610a90c40682f4508af
7
+ data.tar.gz: 88b4193027bbba65871acc89ea0bff8fbf06271fc6dc0888ce5f218fbebed3c74797a7edc8f65aa2c8b3d7ae63c40b3639dc17556b22ccbd486fa7dac969734c
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.3.1".freeze
3
+ VERSION = "3.3.2".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.2"
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.2
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-02-19 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.2
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.2
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