metanorma-ietf 3.2.7 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/ietf/blocks.rb +20 -32
- data/lib/isodoc/ietf/cleanup.rb +16 -176
- data/lib/isodoc/ietf/cleanup_blocks.rb +174 -0
- data/lib/isodoc/ietf/front.rb +200 -199
- data/lib/isodoc/ietf/inline.rb +8 -7
- data/lib/isodoc/ietf/section.rb +48 -48
- data/lib/metanorma/ietf/basicdoc.rng +94 -8
- data/lib/metanorma/ietf/biblio-standoc.rng +44 -1
- data/lib/metanorma/ietf/biblio.rng +11 -0
- data/lib/metanorma/ietf/blocks.rb +5 -1
- data/lib/metanorma/ietf/front.rb +14 -38
- data/lib/metanorma/ietf/ietf.rng +20 -1
- data/lib/metanorma/ietf/isodoc.rng +13 -64
- data/lib/metanorma/ietf/reqt.rng +0 -16
- data/lib/metanorma/ietf/version.rb +1 -1
- data/lib/metanorma-ietf.rb +1 -0
- data/lib/relaton/render/config.yml +2 -1
- data/lib/relaton/render/parse.rb +40 -5
- data/metanorma-ietf.gemspec +2 -1
- metadata +19 -4
@@ -95,8 +95,89 @@
|
|
95
95
|
<ref name="pagebreak"/>
|
96
96
|
<ref name="hr"/>
|
97
97
|
<ref name="bookmark"/>
|
98
|
+
<ref name="amend"/>
|
98
99
|
</choice>
|
99
100
|
</define>
|
101
|
+
<define name="amend">
|
102
|
+
<element name="amend">
|
103
|
+
<ref name="AmendType"/>
|
104
|
+
</element>
|
105
|
+
</define>
|
106
|
+
<define name="AmendType">
|
107
|
+
<optional>
|
108
|
+
<attribute name="id">
|
109
|
+
<data type="ID"/>
|
110
|
+
</attribute>
|
111
|
+
</optional>
|
112
|
+
<attribute name="change">
|
113
|
+
<choice>
|
114
|
+
<value>add</value>
|
115
|
+
<value>modify</value>
|
116
|
+
<value>delete</value>
|
117
|
+
<value>replace</value>
|
118
|
+
</choice>
|
119
|
+
</attribute>
|
120
|
+
<optional>
|
121
|
+
<attribute name="path"/>
|
122
|
+
</optional>
|
123
|
+
<optional>
|
124
|
+
<attribute name="path_end"/>
|
125
|
+
</optional>
|
126
|
+
<optional>
|
127
|
+
<attribute name="title"/>
|
128
|
+
</optional>
|
129
|
+
<optional>
|
130
|
+
<element name="location">
|
131
|
+
<zeroOrMore>
|
132
|
+
<choice>
|
133
|
+
<ref name="locality"/>
|
134
|
+
<ref name="localityStack"/>
|
135
|
+
</choice>
|
136
|
+
</zeroOrMore>
|
137
|
+
</element>
|
138
|
+
</optional>
|
139
|
+
<optional>
|
140
|
+
<element name="description">
|
141
|
+
<zeroOrMore>
|
142
|
+
<ref name="BasicBlock"/>
|
143
|
+
</zeroOrMore>
|
144
|
+
</element>
|
145
|
+
</optional>
|
146
|
+
<optional>
|
147
|
+
<element name="newcontent">
|
148
|
+
<optional>
|
149
|
+
<attribute name="id">
|
150
|
+
<data type="ID"/>
|
151
|
+
</attribute>
|
152
|
+
</optional>
|
153
|
+
<zeroOrMore>
|
154
|
+
<ref name="BasicBlock"/>
|
155
|
+
</zeroOrMore>
|
156
|
+
</element>
|
157
|
+
</optional>
|
158
|
+
<zeroOrMore>
|
159
|
+
<ref name="classification"/>
|
160
|
+
</zeroOrMore>
|
161
|
+
<zeroOrMore>
|
162
|
+
<ref name="contributor"/>
|
163
|
+
</zeroOrMore>
|
164
|
+
</define>
|
165
|
+
<define name="classification">
|
166
|
+
<element name="classification">
|
167
|
+
<ref name="classification_tag"/>
|
168
|
+
<ref name="classification_value"/>
|
169
|
+
</element>
|
170
|
+
</define>
|
171
|
+
<define name="classification_tag">
|
172
|
+
<element name="tag">
|
173
|
+
<text/>
|
174
|
+
</element>
|
175
|
+
</define>
|
176
|
+
<define name="classification_value">
|
177
|
+
<element name="value">
|
178
|
+
<text/>
|
179
|
+
</element>
|
180
|
+
</define>
|
100
181
|
<define name="paragraph">
|
101
182
|
<element name="p">
|
102
183
|
<ref name="ParagraphType"/>
|
@@ -163,6 +244,9 @@
|
|
163
244
|
<data type="ID"/>
|
164
245
|
</attribute>
|
165
246
|
<attribute name="reviewer"/>
|
247
|
+
<optional>
|
248
|
+
<attribute name="type"/>
|
249
|
+
</optional>
|
166
250
|
<optional>
|
167
251
|
<attribute name="date">
|
168
252
|
<data type="dateTime"/>
|
@@ -939,18 +1023,12 @@
|
|
939
1023
|
</optional>
|
940
1024
|
<optional>
|
941
1025
|
<attribute name="width">
|
942
|
-
<
|
943
|
-
<data type="int"/>
|
944
|
-
<value>auto</value>
|
945
|
-
</choice>
|
1026
|
+
<ref name="ImageSize"/>
|
946
1027
|
</attribute>
|
947
1028
|
</optional>
|
948
1029
|
<optional>
|
949
1030
|
<attribute name="height">
|
950
|
-
<
|
951
|
-
<data type="int"/>
|
952
|
-
<value>auto</value>
|
953
|
-
</choice>
|
1031
|
+
<ref name="ImageSize"/>
|
954
1032
|
</attribute>
|
955
1033
|
</optional>
|
956
1034
|
<optional>
|
@@ -965,6 +1043,14 @@
|
|
965
1043
|
</attribute>
|
966
1044
|
</optional>
|
967
1045
|
</define>
|
1046
|
+
<define name="ImageSize">
|
1047
|
+
<choice>
|
1048
|
+
<data type="string">
|
1049
|
+
<param name="pattern">\d+([.]\d+)?(%?)</param>
|
1050
|
+
</data>
|
1051
|
+
<value>auto</value>
|
1052
|
+
</choice>
|
1053
|
+
</define>
|
968
1054
|
<define name="video">
|
969
1055
|
<element name="video">
|
970
1056
|
<attribute name="id">
|
@@ -9,11 +9,42 @@
|
|
9
9
|
-->
|
10
10
|
<include href="biblio.rng">
|
11
11
|
<define name="BibData">
|
12
|
-
<ref name="
|
12
|
+
<ref name="StandardBibliographicItem"/>
|
13
13
|
<optional>
|
14
14
|
<ref name="ext"/>
|
15
15
|
</optional>
|
16
16
|
</define>
|
17
|
+
<define name="docrelation">
|
18
|
+
<element name="relation">
|
19
|
+
<attribute name="type">
|
20
|
+
<ref name="DocRelationType"/>
|
21
|
+
</attribute>
|
22
|
+
<optional>
|
23
|
+
<element name="description">
|
24
|
+
<ref name="FormattedString"/>
|
25
|
+
</element>
|
26
|
+
</optional>
|
27
|
+
<element name="bibitem">
|
28
|
+
<ref name="StandardReducedBibliographicItem"/>
|
29
|
+
</element>
|
30
|
+
<choice>
|
31
|
+
<zeroOrMore>
|
32
|
+
<ref name="locality"/>
|
33
|
+
</zeroOrMore>
|
34
|
+
<zeroOrMore>
|
35
|
+
<ref name="localityStack"/>
|
36
|
+
</zeroOrMore>
|
37
|
+
</choice>
|
38
|
+
<choice>
|
39
|
+
<zeroOrMore>
|
40
|
+
<ref name="sourceLocality"/>
|
41
|
+
</zeroOrMore>
|
42
|
+
<zeroOrMore>
|
43
|
+
<ref name="sourceLocalityStack"/>
|
44
|
+
</zeroOrMore>
|
45
|
+
</choice>
|
46
|
+
</element>
|
47
|
+
</define>
|
17
48
|
</include>
|
18
49
|
<define name="ext">
|
19
50
|
<element name="ext">
|
@@ -161,4 +192,16 @@
|
|
161
192
|
</optional>
|
162
193
|
</element>
|
163
194
|
</define>
|
195
|
+
<define name="StandardBibliographicItem">
|
196
|
+
<ref name="BibliographicItem"/>
|
197
|
+
<zeroOrMore>
|
198
|
+
<ref name="amend"/>
|
199
|
+
</zeroOrMore>
|
200
|
+
</define>
|
201
|
+
<define name="StandardReducedBibliographicItem">
|
202
|
+
<ref name="ReducedBibliographicItem"/>
|
203
|
+
<zeroOrMore>
|
204
|
+
<ref name="amend"/>
|
205
|
+
</zeroOrMore>
|
206
|
+
</define>
|
164
207
|
</grammar>
|
@@ -241,6 +241,9 @@
|
|
241
241
|
</element>
|
242
242
|
</define>
|
243
243
|
<define name="FullNameType">
|
244
|
+
<optional>
|
245
|
+
<ref name="name_abbreviation"/>
|
246
|
+
</optional>
|
244
247
|
<choice>
|
245
248
|
<group>
|
246
249
|
<zeroOrMore>
|
@@ -266,6 +269,11 @@
|
|
266
269
|
<ref name="variantname"/>
|
267
270
|
</zeroOrMore>
|
268
271
|
</define>
|
272
|
+
<define name="name_abbreviation">
|
273
|
+
<element name="abbreviation">
|
274
|
+
<ref name="LocalizedString"/>
|
275
|
+
</element>
|
276
|
+
</define>
|
269
277
|
<define name="prefix">
|
270
278
|
<element name="prefix">
|
271
279
|
<ref name="LocalizedString"/>
|
@@ -870,6 +878,9 @@
|
|
870
878
|
<optional>
|
871
879
|
<ref name="validity"/>
|
872
880
|
</optional>
|
881
|
+
<optional>
|
882
|
+
<ref name="depiction"/>
|
883
|
+
</optional>
|
873
884
|
</define>
|
874
885
|
<define name="btitle">
|
875
886
|
<element name="title">
|
@@ -6,12 +6,15 @@ module Metanorma
|
|
6
6
|
node.attr("keep-with-next"),
|
7
7
|
"keep-with-previous": node.attr("keepWithPrevious") ||
|
8
8
|
node.attr("keep-with-previous"),
|
9
|
+
indent: node.attr("indent"),
|
9
10
|
id: ::Metanorma::Utils::anchor_or_uuid(node))
|
10
11
|
end
|
11
12
|
|
12
13
|
def ul_attrs(node)
|
13
14
|
attr_code(id: ::Metanorma::Utils::anchor_or_uuid(node),
|
14
|
-
nobullet: node.attr("nobullet"),
|
15
|
+
nobullet: node.attr("nobullet") || node.attr("empty"),
|
16
|
+
indent: node.attr("indent"),
|
17
|
+
bare: node.attr("bare"),
|
15
18
|
spacing: node.attr("spacing"))
|
16
19
|
end
|
17
20
|
|
@@ -20,6 +23,7 @@ module Metanorma
|
|
20
23
|
type: node.attr("format") || olist_style(node.style),
|
21
24
|
group: node.attr("group"),
|
22
25
|
spacing: node.attr("spacing"),
|
26
|
+
indent: node.attr("indent"),
|
23
27
|
start: node.attr("start"))
|
24
28
|
end
|
25
29
|
|
data/lib/metanorma/ietf/front.rb
CHANGED
@@ -9,33 +9,9 @@ module Metanorma
|
|
9
9
|
personal_author(node, xml)
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
publishers = node.attr("publisher") || "IETF"
|
15
|
-
csv_split(publishers)&.each do |p|
|
16
|
-
xml.contributor do |c|
|
17
|
-
c.role **{ type: "publisher" }
|
18
|
-
c.organization { |a| organization(a, p, true) }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def metadata_copyright(node, xml)
|
24
|
-
publishers = node.attr("copyright-holder") || node.attr("publisher") || "IETF"
|
25
|
-
csv_split(publishers)&.each do |p|
|
26
|
-
xml.copyright do |c|
|
27
|
-
c.from (node.attr("copyright-year") || Date.today.year)
|
28
|
-
c.owner do |owner|
|
29
|
-
owner.organization { |o| organization(o, p, true) }
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
12
|
+
def default_publisher
|
13
|
+
"IETF"
|
33
14
|
end
|
34
|
-
=end
|
35
|
-
|
36
|
-
def default_publisher
|
37
|
-
"IETF"
|
38
|
-
end
|
39
15
|
|
40
16
|
def org_abbrev
|
41
17
|
{ "Internet Engineering Task Force" => "IETF" }
|
@@ -47,10 +23,10 @@ end
|
|
47
23
|
end
|
48
24
|
a = node.attr("intended-series") and
|
49
25
|
xml.series **{ type: "intended" } do |s|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
26
|
+
parts = a.split(/ /)
|
27
|
+
s.title parts[0]
|
28
|
+
s.number parts[1..-1].join(" ") if parts.size > 1
|
29
|
+
end
|
54
30
|
end
|
55
31
|
|
56
32
|
def title(node, xml)
|
@@ -69,7 +45,7 @@ end
|
|
69
45
|
end
|
70
46
|
|
71
47
|
def metadata_committee(node, xml)
|
72
|
-
|
48
|
+
node.attr("workgroup") or return
|
73
49
|
xml.editorialgroup do |a|
|
74
50
|
committee_component("workgroup", node, a)
|
75
51
|
end
|
@@ -81,14 +57,14 @@ end
|
|
81
57
|
xml.area a
|
82
58
|
end
|
83
59
|
xml.ipr (node.attr("ipr") || "trust200902")
|
84
|
-
x = node.attr("consensus") and xml.consensus x
|
85
|
-
x = node.attr("index-include") and xml.indexInclude x
|
60
|
+
x = node.attr("consensus") and xml.consensus (x != "false")
|
61
|
+
x = node.attr("index-include") and xml.indexInclude (x != "false")
|
86
62
|
x = node.attr("ipr-extract") and xml.iprExtract x
|
87
|
-
x = node.attr("sort-refs") and xml.sortRefs x
|
88
|
-
x = node.attr("sym-refs") and xml.symRefs x
|
89
|
-
x = node.attr("toc-include") and xml.tocInclude x
|
63
|
+
x = node.attr("sort-refs") and xml.sortRefs (x != "false")
|
64
|
+
x = node.attr("sym-refs") and xml.symRefs (x != "false")
|
65
|
+
x = node.attr("toc-include") and xml.tocInclude (x != "false")
|
90
66
|
x = node.attr("toc-depth") and xml.tocDepth x
|
91
|
-
x = node.attr("show-on-front-page") and xml.showOnFrontPage x
|
67
|
+
x = node.attr("show-on-front-page") and xml.showOnFrontPage (x != "false")
|
92
68
|
xml.pi { |pi| set_pi(node, pi) }
|
93
69
|
end
|
94
70
|
|
@@ -135,7 +111,7 @@ end
|
|
135
111
|
|
136
112
|
def pi_code(rfc_pis, pi)
|
137
113
|
rfc_pis.each_pair do |k, v|
|
138
|
-
|
114
|
+
v.nil? and next
|
139
115
|
pi.send k.to_s, v
|
140
116
|
end
|
141
117
|
end
|
data/lib/metanorma/ietf/ietf.rng
CHANGED
@@ -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,10 +17,19 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.
|
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">
|
24
|
+
<define name="amend">
|
25
|
+
<element name="amend">
|
26
|
+
<ref name="BlockAttributes"/>
|
27
|
+
<ref name="AmendType"/>
|
28
|
+
<zeroOrMore>
|
29
|
+
<ref name="autonumber"/>
|
30
|
+
</zeroOrMore>
|
31
|
+
</element>
|
32
|
+
</define>
|
24
33
|
<define name="admonition">
|
25
34
|
<element name="admonition">
|
26
35
|
<attribute name="type">
|
@@ -137,6 +146,9 @@
|
|
137
146
|
<data type="boolean"/>
|
138
147
|
</attribute>
|
139
148
|
</optional>
|
149
|
+
<optional>
|
150
|
+
<attribute name="style"/>
|
151
|
+
</optional>
|
140
152
|
<oneOrMore>
|
141
153
|
<ref name="PureTextElement"/>
|
142
154
|
</oneOrMore>
|
@@ -2319,69 +2331,6 @@
|
|
2319
2331
|
<ref name="CitationType"/>
|
2320
2332
|
</element>
|
2321
2333
|
</define>
|
2322
|
-
<define name="amend">
|
2323
|
-
<element name="amend">
|
2324
|
-
<optional>
|
2325
|
-
<attribute name="id">
|
2326
|
-
<data type="ID"/>
|
2327
|
-
</attribute>
|
2328
|
-
</optional>
|
2329
|
-
<attribute name="change">
|
2330
|
-
<choice>
|
2331
|
-
<value>add</value>
|
2332
|
-
<value>modify</value>
|
2333
|
-
<value>delete</value>
|
2334
|
-
<value>replace</value>
|
2335
|
-
</choice>
|
2336
|
-
</attribute>
|
2337
|
-
<optional>
|
2338
|
-
<attribute name="path"/>
|
2339
|
-
</optional>
|
2340
|
-
<optional>
|
2341
|
-
<attribute name="path_end"/>
|
2342
|
-
</optional>
|
2343
|
-
<optional>
|
2344
|
-
<attribute name="title"/>
|
2345
|
-
</optional>
|
2346
|
-
<ref name="BlockAttributes"/>
|
2347
|
-
<optional>
|
2348
|
-
<element name="location">
|
2349
|
-
<zeroOrMore>
|
2350
|
-
<ref name="locality"/>
|
2351
|
-
</zeroOrMore>
|
2352
|
-
</element>
|
2353
|
-
</optional>
|
2354
|
-
<zeroOrMore>
|
2355
|
-
<ref name="autonumber"/>
|
2356
|
-
</zeroOrMore>
|
2357
|
-
<optional>
|
2358
|
-
<element name="description">
|
2359
|
-
<zeroOrMore>
|
2360
|
-
<ref name="BasicBlock"/>
|
2361
|
-
</zeroOrMore>
|
2362
|
-
</element>
|
2363
|
-
</optional>
|
2364
|
-
<optional>
|
2365
|
-
<element name="newcontent">
|
2366
|
-
<optional>
|
2367
|
-
<attribute name="id">
|
2368
|
-
<data type="ID"/>
|
2369
|
-
</attribute>
|
2370
|
-
</optional>
|
2371
|
-
<zeroOrMore>
|
2372
|
-
<ref name="BasicBlock"/>
|
2373
|
-
</zeroOrMore>
|
2374
|
-
</element>
|
2375
|
-
</optional>
|
2376
|
-
<optional>
|
2377
|
-
<element name="description">
|
2378
|
-
<zeroOrMore>
|
2379
|
-
<ref name="BasicBlock"/>
|
2380
|
-
</zeroOrMore>
|
2381
|
-
</element>
|
2382
|
-
</optional>
|
2383
|
-
</element>
|
2384
|
-
</define>
|
2385
2334
|
<define name="autonumber">
|
2386
2335
|
<element name="autonumber">
|
2387
2336
|
<attribute name="type">
|
data/lib/metanorma/ietf/reqt.rng
CHANGED
@@ -207,20 +207,4 @@
|
|
207
207
|
<value>permission</value>
|
208
208
|
</choice>
|
209
209
|
</define>
|
210
|
-
<define name="classification">
|
211
|
-
<element name="classification">
|
212
|
-
<ref name="classification_tag"/>
|
213
|
-
<ref name="classification_value"/>
|
214
|
-
</element>
|
215
|
-
</define>
|
216
|
-
<define name="classification_tag">
|
217
|
-
<element name="tag">
|
218
|
-
<text/>
|
219
|
-
</element>
|
220
|
-
</define>
|
221
|
-
<define name="classification_value">
|
222
|
-
<element name="value">
|
223
|
-
<text/>
|
224
|
-
</element>
|
225
|
-
</define>
|
226
210
|
</grammar>
|
data/lib/metanorma-ietf.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/relaton/render/parse.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
data/metanorma-ietf.gemspec
CHANGED
@@ -37,8 +37,9 @@ 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.
|
40
|
+
spec.add_dependency "metanorma-standoc", "~> 2.8.0"
|
41
41
|
spec.add_dependency "relaton-render"
|
42
|
+
spec.add_dependency "vectory", "~> 0.6"
|
42
43
|
|
43
44
|
spec.add_development_dependency "debug"
|
44
45
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|