metanorma-ietf 3.3.0 → 3.3.1

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.1".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> {% 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
@@ -24,7 +24,8 @@ module Relaton
24
24
 
25
25
  def series_xml2hash1(series, doc)
26
26
  ret = super
27
- %w(BCP RFC I-D. Internet-Draft).include?(ret[:series_title]) and return {}
27
+ %w(BCP RFC I-D. Internet-Draft).include?(ret[:series_title]) and
28
+ return {}
28
29
  ret
29
30
  end
30
31
 
@@ -87,14 +88,48 @@ module Relaton
87
88
  super
88
89
  end
89
90
 
90
- # add BCP number
91
+ # do not add BCP number, it is not included in IETF practice
91
92
  def authoritative_identifier(doc)
92
93
  ret = super
93
- if bcp = doc.series.detect { |s| s.title.title.content == "BCP" }
94
- ret.unshift("BCP #{bcp.number}")
95
- end
94
+ #if bcp = doc.series.detect { |s| s.title.title.content == "BCP" }
95
+ #ret.unshift("BCP #{bcp.number}")
96
+ #end
96
97
  ret.reject { |x| /^(rfc-anchor|Internet-Draft)/.match? (x) }
97
98
  end
99
+
100
+ def simple_xml2hash(doc)
101
+ super.merge(stream: stream(doc))
102
+ end
103
+
104
+ def series(doc)
105
+ a = doc.series.reject { |s| s.type == "stream" }
106
+ a.empty? and return nil
107
+ a.detect { |s| s.type == "main" } ||
108
+ a.detect { |s| s.type.nil? } || a.first
109
+ end
110
+
111
+ def stream(doc)
112
+ a = doc.series.detect { |s| s.type == "stream" } or return nil
113
+ series_title(a, doc)
114
+ end
115
+
116
+ def extract(doc)
117
+ super.merge(included_xml2hash(doc))
118
+ end
119
+
120
+ def included_xml2hash(doc)
121
+ r = doc.relation.select { |x| x.type == "includes" }
122
+ .map { |x| parse_single_bibitem(x.bibitem) }
123
+ r.empty? and return {}
124
+ { included: r }
125
+ end
126
+
127
+ 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)
132
+ end
98
133
  end
99
134
  end
100
135
  end
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.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: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-ietf-data
@@ -250,6 +250,7 @@ files:
250
250
  - lib/isodoc/ietf/SVG-1.2-RFC.rng
251
251
  - lib/isodoc/ietf/blocks.rb
252
252
  - lib/isodoc/ietf/cleanup.rb
253
+ - lib/isodoc/ietf/cleanup_blocks.rb
253
254
  - lib/isodoc/ietf/cleanup_inline.rb
254
255
  - lib/isodoc/ietf/footnotes.rb
255
256
  - lib/isodoc/ietf/front.rb