metanorma-ietf 3.3.0 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,6 +30,9 @@
30
30
  <data type="boolean"/>
31
31
  </attribute>
32
32
  </optional>
33
+ <optional>
34
+ <attribute name="indent"/>
35
+ </optional>
33
36
  <zeroOrMore>
34
37
  <ref name="TextElement"/>
35
38
  </zeroOrMore>
@@ -47,6 +50,9 @@
47
50
  <ref name="Alignments"/>
48
51
  </attribute>
49
52
  </optional>
53
+ <optional>
54
+ <attribute name="indent"/>
55
+ </optional>
50
56
  <zeroOrMore>
51
57
  <choice>
52
58
  <ref name="TextElement"/>
@@ -64,11 +70,21 @@
64
70
  <data type="ID"/>
65
71
  </attribute>
66
72
  <optional>
67
- <attribute name="nobullet"/>
73
+ <attribute name="nobullet">
74
+ <data type="boolean"/>
75
+ </attribute>
68
76
  </optional>
69
77
  <optional>
70
78
  <attribute name="spacing"/>
71
79
  </optional>
80
+ <optional>
81
+ <attribute name="indent"/>
82
+ </optional>
83
+ <optional>
84
+ <attribute name="bare">
85
+ <data type="boolean"/>
86
+ </attribute>
87
+ </optional>
72
88
  <oneOrMore>
73
89
  <ref name="li"/>
74
90
  </oneOrMore>
@@ -101,6 +117,9 @@
101
117
  <optional>
102
118
  <attribute name="start"/>
103
119
  </optional>
120
+ <optional>
121
+ <attribute name="indent"/>
122
+ </optional>
104
123
  <oneOrMore>
105
124
  <ref name="li"/>
106
125
  </oneOrMore>
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.12 -->
20
+ <!-- VERSION v1.3.0 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -146,6 +146,9 @@
146
146
  <data type="boolean"/>
147
147
  </attribute>
148
148
  </optional>
149
+ <optional>
150
+ <attribute name="style"/>
151
+ </optional>
149
152
  <oneOrMore>
150
153
  <ref name="PureTextElement"/>
151
154
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.3.0".freeze
3
+ VERSION = "3.3.2".freeze
4
4
  end
5
5
  end
@@ -19,7 +19,8 @@ journaltemplate: "{% if series_title and series_num %}<seriesInfo_name='{{ serie
19
19
  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
- standard: "<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 i in authoritative_identifier %} <seriesInfo_value='{{ i | replace: ' ', ' ' | strip | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if i contains 'I-D.'%}Internet-Draft{% else %}{{ i | replace: ' ', ' ' | strip | split: ' ' | slice: -2 }}{%endif%}'/> {% endfor %} {% else %} <refcontent>{{authoritative_identifier | join: ', '}}</refcontent> {% endif %}"
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 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 %}"
23
24
  website: standard
24
25
  book: standard
25
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]),
@@ -24,7 +29,8 @@ module Relaton
24
29
 
25
30
  def series_xml2hash1(series, doc)
26
31
  ret = super
27
- %w(BCP RFC I-D. Internet-Draft).include?(ret[:series_title]) and return {}
32
+ %w(BCP RFC I-D. Internet-Draft).include?(ret[:series_title]) and
33
+ return {}
28
34
  ret
29
35
  end
30
36
 
@@ -87,14 +93,49 @@ module Relaton
87
93
  super
88
94
  end
89
95
 
90
- # add BCP number
91
96
  def authoritative_identifier(doc)
92
97
  ret = super
93
- if bcp = doc.series.detect { |s| s.title.title.content == "BCP" }
94
- ret.unshift("BCP #{bcp.number}")
98
+ bcp = doc.series.detect do |s|
99
+ %w(BCP STD).include?(s.title.title.content)
95
100
  end
101
+ bcp and ret.unshift("BCP #{bcp.number}")
96
102
  ret.reject { |x| /^(rfc-anchor|Internet-Draft)/.match? (x) }
97
103
  end
104
+
105
+ def simple_xml2hash(doc)
106
+ super.merge(stream: stream(doc))
107
+ end
108
+
109
+ def series(doc)
110
+ a = doc.series.reject { |s| s.type == "stream" }
111
+ a.empty? and return nil
112
+ a.detect { |s| s.type == "main" } ||
113
+ a.detect { |s| s.type.nil? } || a.first
114
+ end
115
+
116
+ def stream(doc)
117
+ a = doc.series.detect { |s| s.type == "stream" } or return nil
118
+ series_title(a, doc)
119
+ end
120
+
121
+ def extract(doc)
122
+ super.merge(included_xml2hash(doc))
123
+ end
124
+
125
+ def included_xml2hash(doc)
126
+ r = doc.relation.select { |x| x.type == "includes" }.map do |x|
127
+ parse_single_bibitem(x.bibitem)
128
+ end
129
+ r.empty? and return {}
130
+ { included: r }
131
+ end
132
+
133
+ def parse_single_bibitem(doc)
134
+ data = extract(doc)
135
+ # enhance_data(data, r.template_raw)
136
+ # data_liquid = @fieldsklass.new(renderer: self)
137
+ # .compound_fields_format(data)
138
+ end
98
139
  end
99
140
  end
100
141
  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.0
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-01-09 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
@@ -250,6 +236,7 @@ files:
250
236
  - lib/isodoc/ietf/SVG-1.2-RFC.rng
251
237
  - lib/isodoc/ietf/blocks.rb
252
238
  - lib/isodoc/ietf/cleanup.rb
239
+ - lib/isodoc/ietf/cleanup_blocks.rb
253
240
  - lib/isodoc/ietf/cleanup_inline.rb
254
241
  - lib/isodoc/ietf/footnotes.rb
255
242
  - lib/isodoc/ietf/front.rb