metanorma-ietf 3.2.3 → 3.2.4

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: 44f82a2e2531457841566622014de866954e414a6fcdb4a21ca279ab21d4254e
4
- data.tar.gz: ccfb59ff0df711e0994398124e61ad7d132a9142e53fb53b6feb75a5c8c3feac
3
+ metadata.gz: 15679fd3c253726b9f401c099a73c02f242a946eb358b4c7dc025f13d5aa0ed8
4
+ data.tar.gz: c2fef641bba26aff816757f36a6f61642190f0120874c2a01165a2513b5bb5db
5
5
  SHA512:
6
- metadata.gz: a3cf1a3627c0dc5a7a380c9cf0c3504941d6e23bf8a23d6d7c2b3430b1ef27039fd9b37cfb40a383ce0ef3714dfa5462f8d70acd471debe474e90b14c6ebfd2d
7
- data.tar.gz: 75321da1a28864666a818e95130e16156aa7ebf582a5d184106aa8ccb798ae50cf3d10cec0379ed3a3cb48e6b24cc495adef8d5400d19d9825f0b1579f8a93ce
6
+ metadata.gz: 25c51c60d9b85a0693db8c21f3159b4875fbb0cb430a0cdbf17b33d527d1ace7106bc118d9dde7f0b607953c1c459b43688c4121e110379ef7420336822d0861
7
+ data.tar.gz: ca609bafe3ade87598fd0b87de4de63e6649a2c1e976f0f94768e778c98c0163561eac55a2d20d6872e8b48cb46ac5c0791ee2590827047e83c4b018521a0557
@@ -23,6 +23,7 @@ module IsoDoc
23
23
  def biblio_cleanup(xmldoc)
24
24
  biblio_abstract_cleanup(xmldoc)
25
25
  biblio_date_cleanup(xmldoc)
26
+ biblio_refcontent_cleanup(xmldoc)
26
27
  annotation_cleanup(xmldoc)
27
28
  end
28
29
 
@@ -49,6 +50,15 @@ module IsoDoc
49
50
  end
50
51
  end
51
52
 
53
+ def biblio_refcontent_cleanup(xmldoc)
54
+ xmldoc.xpath("//refcontent").each do |a|
55
+ val = a.text.strip
56
+ if val.empty? then a.remove
57
+ else a.children = val
58
+ end
59
+ end
60
+ end
61
+
52
62
  def reparse_abstract(abstract)
53
63
  a1 = Nokogiri::XML(abstract.dup.to_xml
54
64
  .sub("<abstract>", "<abstract xmlns='http://www.example.com'>")).root
@@ -130,10 +140,10 @@ module IsoDoc
130
140
 
131
141
  def make_postamble(docxml)
132
142
  docxml.xpath("//figure").each do |f|
133
- a = f&.at("./artwork | ./sourcecode") || next
134
- name = f&.at("./name")&.remove
135
- b = a&.xpath("./preceding-sibling::*")&.remove
136
- c = a&.xpath("./following-sibling::*")&.remove
143
+ a = f.at("./artwork | ./sourcecode") || next
144
+ name = f.at("./name")&.remove
145
+ b = a.xpath("./preceding-sibling::*")&.remove
146
+ c = a.xpath("./following-sibling::*")&.remove
137
147
  a = a.remove
138
148
  name and f << name
139
149
  b.empty? or f << "<preamble>#{to_xml(b)}</preamble>"
@@ -211,7 +221,7 @@ module IsoDoc
211
221
 
212
222
  def dt_cleanup(docxml)
213
223
  docxml.xpath("//dt").each do |d|
214
- d&.first_element_child&.name == "bookmark" and
224
+ d.first_element_child&.name == "bookmark" and
215
225
  d["anchor"] ||= d.first_element_child["anchor"]
216
226
  d.xpath(".//t").each do |t|
217
227
  d["anchor"] ||= t["anchor"]
@@ -67,133 +67,6 @@ module IsoDoc
67
67
  bib1.namespace = nil
68
68
  ref << @bibrenderer.render(bib1.to_xml, embedded: true)
69
69
  end
70
-
71
- =begin
72
-
73
- def nonstd_bibitem(list, bib, _ordinal, _bibliography)
74
- uris = bib.xpath(ns("./uri"))
75
- target = nil
76
- uris&.each { |u| target = u.text if u["type"] == "src" }
77
- list.reference **attr_code(target: target,
78
- anchor: bib["id"]) do |r|
79
- nonstd_bibitem_front(r, bib)
80
- uris&.each do |u|
81
- r.format nil, **attr_code(target: u.text, type: u["type"])
82
- end
83
- docidentifier_render(bib, r)
84
- end
85
- end
86
-
87
- def docidentifier_render(bib, out)
88
- docidentifiers = bib.xpath(ns("./docidentifier"))
89
- id = render_identifier(bibitem_ref_code(bib))
90
- !id[:sdo].nil? && id[:sdo] != "(NO ID)" and out.refcontent id[:sdo]
91
- docidentifiers&.each do |u|
92
- u["type"] == "DOI" and
93
- out.seriesInfo nil, **attr_code(value: u.text.sub(/^DOI[  ]/, ""),
94
- name: "DOI")
95
- %w(IETF RFC).include?(u["type"]) and docidentifier_ietf(u, out)
96
- end
97
- end
98
-
99
- def docidentifier_ietf(ident, out)
100
- if /^RFC[  ]/.match?(ident.text)
101
- out.seriesInfo nil, **attr_code(value: ident.text.sub(/^RFC[  ]0*/, ""),
102
- name: "RFC")
103
- elsif /^I-D\./.match?(ident.text)
104
- out.seriesInfo nil, **attr_code(value: ident.text.sub(/^I-D\./, ""),
105
- name: "Internet-Draft")
106
- end
107
- end
108
-
109
- def nonstd_bibitem_front(ref, bib)
110
- ref.front do |f|
111
- relaton_to_title(bib, f)
112
- relaton_to_author(bib, f)
113
- relaton_to_date(bib, f)
114
- relaton_to_keyword(bib, f)
115
- relaton_to_abstract(bib, f)
116
- end
117
- end
118
-
119
- def relaton_to_title(bib, node)
120
- title = bib&.at(ns("./title")) || bib&.at(ns("./formattedref")) or
121
- return
122
- node.title do |t|
123
- title.children.each { |n| parse(n, t) }
124
- end
125
- end
126
-
127
- def relaton_to_author(bib, node)
128
- auths = bib.xpath(ns("./contributor[xmlns:role/@type = 'author' or " \
129
- "xmlns:role/@type = 'editor']"))
130
- auths.empty? and
131
- auths = bib.xpath(ns("./contributor[xmlns:role/@type = " \
132
- "'publisher']"))
133
- auths.each do |a|
134
- role = a.at(ns("./role[@type = 'editor']")) ? "editor" : nil
135
- (p = a&.at(ns("./person/name")) and
136
- relaton_person_to_author(p, role, node)) or
137
- relaton_org_to_author(a&.at(ns("./organization")), role, node)
138
- end
139
- end
140
-
141
- def relaton_person_to_author(pers, role, node)
142
- full = pers.at(ns("./completename"))&.text
143
- surname = pers.at(ns("./surname"))&.text
144
- initials = pers.xpath(ns("./initial"))&.map(&:text)&.join(" ") ||
145
- pers.xpath(ns("./forename"))&.map { |i| i.text[0] }&.join(" ")
146
- initials = nil if initials.empty?
147
- node.author nil, **attr_code(
148
- fullname: full,
149
- asciiFullname: full&.transliterate,
150
- role: role, surname: surname,
151
- initials: initials,
152
- asciiSurname: full ? surname&.transliterate : nil,
153
- asciiInitials: full ? initials&.transliterate : nil
154
- )
155
- end
156
-
157
- def relaton_org_to_author(org, _role, node)
158
- name = org&.at(ns("./name"))&.text
159
- abbrev = org&.at(ns("./abbreviation"))&.text
160
- node.author do |_a|
161
- node.organization name, **attr_code(ascii: name&.transliterate,
162
- abbrev: abbrev)
163
- end
164
- end
165
-
166
- def relaton_to_date(bib, node)
167
- date = bib.at(ns("./date[@type = 'published']")) ||
168
- bib.at(ns("./date[@type = 'issued']")) ||
169
- bib.at(ns("./date[@type = 'circulated']"))
170
- date or return
171
- attr = date_attr(date.at(ns("./on | ./from"))&.text) or return
172
- node.date **attr_code(attr)
173
- end
174
-
175
- def relaton_to_keyword(bib, node)
176
- bib.xpath(ns("./keyword")).each do |k|
177
- node.keyword do |keyword|
178
- k.children.each { |n| parse(n, keyword) }
179
- end
180
- end
181
- end
182
-
183
- def relaton_to_abstract(bib, node)
184
- bib.xpath(ns("./abstract")).each do |k|
185
- node.abstract do |abstract|
186
- if k.at(ns("./p"))
187
- k.children.each { |n| parse(n, abstract) }
188
- else
189
- abstract.t do |t|
190
- k.children.each { |n| parse(n, t) }
191
- end
192
- end
193
- end
194
- end
195
- end
196
- =end
197
70
  end
198
71
  end
199
72
  end
@@ -914,44 +914,47 @@
914
914
  -->
915
915
  <define name="image">
916
916
  <element name="image">
917
- <attribute name="id">
918
- <data type="ID"/>
917
+ <ref name="Image"/>
918
+ </element>
919
+ </define>
920
+ <define name="Image">
921
+ <attribute name="id">
922
+ <data type="ID"/>
923
+ </attribute>
924
+ <attribute name="src">
925
+ <data type="anyURI"/>
926
+ </attribute>
927
+ <attribute name="mimetype"/>
928
+ <optional>
929
+ <attribute name="filename"/>
930
+ </optional>
931
+ <optional>
932
+ <attribute name="width">
933
+ <choice>
934
+ <data type="int"/>
935
+ <value>auto</value>
936
+ </choice>
919
937
  </attribute>
920
- <attribute name="src">
938
+ </optional>
939
+ <optional>
940
+ <attribute name="height">
941
+ <choice>
942
+ <data type="int"/>
943
+ <value>auto</value>
944
+ </choice>
945
+ </attribute>
946
+ </optional>
947
+ <optional>
948
+ <attribute name="alt"/>
949
+ </optional>
950
+ <optional>
951
+ <attribute name="title"/>
952
+ </optional>
953
+ <optional>
954
+ <attribute name="longdesc">
921
955
  <data type="anyURI"/>
922
956
  </attribute>
923
- <attribute name="mimetype"/>
924
- <optional>
925
- <attribute name="filename"/>
926
- </optional>
927
- <optional>
928
- <attribute name="width">
929
- <choice>
930
- <data type="int"/>
931
- <value>auto</value>
932
- </choice>
933
- </attribute>
934
- </optional>
935
- <optional>
936
- <attribute name="height">
937
- <choice>
938
- <data type="int"/>
939
- <value>auto</value>
940
- </choice>
941
- </attribute>
942
- </optional>
943
- <optional>
944
- <attribute name="alt"/>
945
- </optional>
946
- <optional>
947
- <attribute name="title"/>
948
- </optional>
949
- <optional>
950
- <attribute name="longdesc">
951
- <data type="anyURI"/>
952
- </attribute>
953
- </optional>
954
- </element>
957
+ </optional>
955
958
  </define>
956
959
  <define name="video">
957
960
  <element name="video">
@@ -348,6 +348,9 @@
348
348
  <zeroOrMore>
349
349
  <ref name="contact"/>
350
350
  </zeroOrMore>
351
+ <optional>
352
+ <ref name="logo"/>
353
+ </optional>
351
354
  </element>
352
355
  </define>
353
356
  <define name="orgname">
@@ -366,6 +369,11 @@
366
369
  </choice>
367
370
  </element>
368
371
  </define>
372
+ <define name="logo">
373
+ <element name="logo">
374
+ <ref name="image"/>
375
+ </element>
376
+ </define>
369
377
  <define name="NameWithVariants">
370
378
  <element name="primary">
371
379
  <ref name="LocalizedString"/>
@@ -942,6 +950,7 @@
942
950
  <value>obsoleted</value>
943
951
  <value>confirmed</value>
944
952
  <value>updated</value>
953
+ <value>corrected</value>
945
954
  <value>issued</value>
946
955
  <value>transmitted</value>
947
956
  <value>copied</value>
@@ -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.6 -->
20
+ <!-- VERSION v1.2.8 -->
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">
@@ -1054,6 +1054,17 @@
1054
1054
  <ref name="date_inline"/>
1055
1055
  </choice>
1056
1056
  </define>
1057
+ <define name="PureTextElement" combine="choice">
1058
+ <ref name="passthrough_inline"/>
1059
+ </define>
1060
+ <define name="passthrough_inline">
1061
+ <element name="passthrough">
1062
+ <optional>
1063
+ <attribute name="formats"/>
1064
+ </optional>
1065
+ <text/>
1066
+ </element>
1067
+ </define>
1057
1068
  <define name="add">
1058
1069
  <element name="add">
1059
1070
  <choice>
@@ -1092,6 +1103,9 @@
1092
1103
  <optional>
1093
1104
  <attribute name="style"/>
1094
1105
  </optional>
1106
+ <optional>
1107
+ <attribute name="custom-charset"/>
1108
+ </optional>
1095
1109
  <oneOrMore>
1096
1110
  <ref name="TextElement"/>
1097
1111
  </oneOrMore>
@@ -1394,6 +1408,9 @@
1394
1408
  <optional>
1395
1409
  <attribute name="number"/>
1396
1410
  </optional>
1411
+ <optional>
1412
+ <attribute name="branch-number"/>
1413
+ </optional>
1397
1414
  <optional>
1398
1415
  <attribute name="obligation">
1399
1416
  <choice>
@@ -1617,6 +1634,9 @@
1617
1634
  <optional>
1618
1635
  <attribute name="number"/>
1619
1636
  </optional>
1637
+ <optional>
1638
+ <attribute name="branch-number"/>
1639
+ </optional>
1620
1640
  <optional>
1621
1641
  <attribute name="type"/>
1622
1642
  </optional>
@@ -1668,6 +1688,9 @@
1668
1688
  <optional>
1669
1689
  <attribute name="number"/>
1670
1690
  </optional>
1691
+ <optional>
1692
+ <attribute name="branch-number"/>
1693
+ </optional>
1671
1694
  <optional>
1672
1695
  <ref name="section-title"/>
1673
1696
  </optional>
@@ -1765,6 +1788,9 @@
1765
1788
  <optional>
1766
1789
  <attribute name="number"/>
1767
1790
  </optional>
1791
+ <optional>
1792
+ <attribute name="branch-number"/>
1793
+ </optional>
1768
1794
  <optional>
1769
1795
  <attribute name="obligation">
1770
1796
  <choice>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.2.3".freeze
3
+ VERSION = "3.2.4".freeze
4
4
  end
5
5
  end
@@ -8,18 +8,18 @@ extenttemplate:
8
8
  inbook: "{{ volume }} {{ page }}"
9
9
  misc: "{{ volume }} {{issue}} {{ page }}, {{ duration }}"
10
10
  nametemplate:
11
- one: "{% if nonpersonal[0] %}<author><organization_ascii='{{nonpersonal[0] | dfhdsjfhsajdkfgkj }}'{% if nonpersonalabbrev[0] %}_abbrev='{{ nonpersonalabbrev[0]}}'{% endif %}>{{ nonpersonal[0] }}</organization></author>{% else %}{% if surname[0] %}<author_surname='{{surname[0]}}'_asciiSurname='{{surname[0] | ascii }}'_initials='{{initials[0] | join: ''}}'_asciiInitials='{{initials[0] | join: '' | ascii}}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% else %}{% if completename[0] %}<author_fullname='{{completename[0]}}'_asciiFullname='{{completename[0] | ascii }}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% endif %}{% endif %}{% endif %}"
11
+ one: "{% if nonpersonal[0] %}<author><organization_ascii='{{nonpersonal[0] | ascii }}'{% if nonpersonalabbrev[0] %}_abbrev='{{ nonpersonalabbrev[0]}}'{% endif %}>{{ nonpersonal[0] }}</organization></author>{% else %}{% if surname[0] %}<author_surname='{{surname[0]}}'_asciiSurname='{{surname[0] | ascii }}'_initials='{{initials[0] | join: ''}}'_asciiInitials='{{initials[0] | join: '' | ascii}}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% else %}{% if completename[0] %}<author_fullname='{{completename[0]}}'_asciiFullname='{{completename[0] | ascii }}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% endif %}{% endif %}{% endif %}"
12
12
  two: "{% if nonpersonal[0] %}<author><organization_ascii='{{nonpersonal[0] | ascii }}'_abbrev='{{ nonpersonalabbrev[0]}}'>{{ nonpersonal[0] }}</organization></author>{% else %}{% if surname[0] %}<author_surname='{{surname[0]}}'_asciiSurname='{{ surname[0] | ascii }}'_initials='{{initials[0] | join: ''}}'_asciiInitials='{{initials[0] | join: '' | ascii}}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% else %}{% if completename[0] %}<author_fullname='{{completename[0]}}'_asciiFullname='{{completename[0] | ascii }}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% endif %}{% endif %}{% endif %} {% if nonpersonal[1] %}<author><organization_ascii='{{nonpersonal[1] | ascii }}'_abbrev='{{ nonpersonalabbrev[1]}}'>{{ nonpersonal[1] }}</organization></author>{% else %}{% if surname[0] %}<author_surname='{{surname[1]}}'_asciiSurname='{{ surname[1] | ascii }}'_initials='{{initials[1] | join: ''}}'_asciiInitials='{{initials[1] | join: '' | ascii}}'{%if role[1] %}_role='{{role[1]}}'{%endif%}/>{% else %}{% if completename[1] %}<author_fullname='{{completename[1]}}'_asciiFullname='{{completename[1] | ascii }}'{%if role[1] %}_role='{{role[1]}}'{%endif%}/>{% endif %}{%endif%}{% endif %}"
13
13
  more: "{% if nonpersonal[0] %}<author><organization_ascii='{{nonpersonal[0] | ascii }}'_abbrev='{{ nonpersonalabbrev[0]}}'>{{ nonpersonal[0] }}</organization></author>{% else %}{% if surname[0] %}<author_surname='{{surname[0]}}'_asciiSurname='{{ surname[0] | ascii }}'_initials='{{initials[0] | join: ''}}'_asciiInitials='{{initials[0] | join: '' | ascii}}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% else %}{% if completename[0] %}<author_fullname='{{completename[0]}}'_asciiFullname='{{completename[0] | ascii }}'{%if role[0] %}_role='{{role[0]}}'{%endif%}/>{% endif %}{% endif %}{%endif%} {% if nonpersonal[1] %}<author><organization_ascii='{{nonpersonal[1] | ascii }}'_abbrev='{{ nonpersonalabbrev[1]}}'>{{ nonpersonal[1] }}</organization></author>{% else %}{%if surname[1] %}<author_surname='{{surname[1]}}'_asciiSurname='{{ surname[1] | ascii }}'_initials='{{initials[1] | join: ''}}'_asciiInitials='{{initials[1] | join: '' | ascii}}'{%if role[1] %}_role='{{role[1]}}'{%endif%}/>{% else %}{% if completename[1] %}<author_fullname='{{completename[1]}}'_asciiFullname='{{completename[1] | ascii }}'{%if role[1] %}_role='{{role[1]}}'{%endif%}/>{% endif %}{% endif %}{% endif %} {% if nonpersonal[2] or nonpersonalabbrev[2] %}<author><organization_ascii='{{nonpersonal[2] | ascii }}'_abbrev='{{ nonpersonalabbrev[2]}}'>{{ nonpersonal[2] }}</organization></author>{% else %}{% if surname[2] %}<author_surname='{{surname[2]}}'_asciiSurname='{{ surname[2] | ascii }}'_initials='{{initials[2] | join: ''}}'_asciiInitials='{{initials[2] | join: '' | ascii}}'{%if role[2] %}_role='{{role[2]}}'{%endif%}/>{% else %}{% if completename[2] %}<author_fullname='{{completename[2]}}'_asciiFullname='{{completename[2] | ascii }}'{%if role[2] %}_role='{{role[2]}}'{%endif%}/>{% endif %}{% endif %}{% endif %}"
14
14
  # disabled the following: they should be provided in inheriting calls
15
15
  # etal: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] | upcase}} ,_{%if given[0]%}{{given[0]}} {{middle[0]}}{%else%}{{initials[0] | join: ' '}}.{%endif%}{% endif %}, {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{%if given[1]%}{{given[1]}} {{middle[1]}}{%else%}{{initials[1] | join: ' '}}.{%endif%} {{surname[1] | upcase}}{% endif %} <em>et al.</em>"
16
16
  # etal_count: 5
17
- seriestemplate: "{% if series_formatted %}{{ series_formatted }}{%else%}{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %} ({{series_run}}) {{series_num}}|({{series_partnumber}}){%endif%}"
18
- journaltemplate: "<em>{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %}</em> ({{series_run}}) {{ labels['volume'] }}_{{series_num}} {{ labels['part'] }}_{{series_partnumber}}"
17
+ seriestemplate: "{% if series_title and series_num %}<seriesInfo_name='{{ series_title }}'_value='{{series_num}}'/>{% else %}{% if series_formatted %}<refcontent>{{ series_formatted }}</refcontent>{% else %}{% if series_title %}<refcontent> {{series_title}} {{ series_run }} ,_{{ series_org }} ,_{{ series_place }} ,_{{ series_dates }} </refcontent>{% endif %}{% endif %}{% endif %}"
18
+ journaltemplate: "{% if series_title and series_num %}<seriesInfo_name='{{ series_title }}'_value='{{series_num}}'/>{% else %}{% if series_formatted %}<refcontent>{{ series_formatted }}</refcontent>{% else %}{% if series_title %}<refcontent> {{series_title}} {{ series_run }} ,_{{ series_org }} ,_{{ series_place }} ,_{{ series_dates }} </refcontent>{% endif %}{% endif %}{% endif %}"
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 %} {%for d in doi %}<seriesInfo value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | strip }}' name='DOI'/>{% endfor %} {%if authoritative_identifier[0]%}{%if home_standard %}<seriesInfo value='{{ authoritative_identifier[0] | remove_first: 'IETF' | remove_first: 'RFC' | remove_first: 'I-D.' | replace: ' ', ' ' | strip}}' name='{%if authoritative_identifier[0] contains 'RFC'%}RFC{%endif%}{%if authoritative_identifier[0] contains 'I-D.'%}Internet-Draft{%endif%}'/>{% else %}<refcontent>{{authoritative_identifier[0]}}</refcontent>{% endif %}{%endif%}"
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 %}"
23
23
  website: standard
24
24
  book: standard
25
25
  booklet: standard
@@ -11,7 +11,7 @@ module Relaton
11
11
 
12
12
  def home_standard(_doc, pubs)
13
13
  pubs&.any? do |r|
14
- ["Internet Engineering Task Force", "IETF"]
14
+ ["Internet Engineering Task Force", "IETF", "RFC Publisher"]
15
15
  .include?(r[:nonpersonal])
16
16
  end
17
17
  end
@@ -22,6 +22,12 @@ module Relaton
22
22
  authorizer)
23
23
  end
24
24
 
25
+ def series_xml2hash1(series, doc)
26
+ ret = super
27
+ %w(BCP RFC I-D. Internet-Draft).include?(ret[:series_title]) and return {}
28
+ ret
29
+ end
30
+
25
31
  def uris(doc)
26
32
  doc.link.map { |u| { content: u.content.to_s.strip, type: u.type } }
27
33
  end
@@ -80,6 +86,15 @@ module Relaton
80
86
  cr.empty? or return cr
81
87
  super
82
88
  end
89
+
90
+ # add BCP number
91
+ def authoritative_identifier(doc)
92
+ ret = super
93
+ if bcp = doc.series.detect { |s| s.title.title.content == "BCP" }
94
+ ret.unshift("BCP #{bcp.number}")
95
+ end
96
+ ret.reject { |x| /^(rfc-anchor|Internet-Draft)/.match? (x) }
97
+ end
83
98
  end
84
99
  end
85
100
  end
@@ -37,7 +37,7 @@ 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.6.0"
40
+ spec.add_dependency "metanorma-standoc", "~> 2.6.3"
41
41
  spec.add_dependency "relaton-render"
42
42
 
43
43
  spec.add_development_dependency "debug"
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.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-06 00:00:00.000000000 Z
11
+ date: 2023-11-20 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.6.0
33
+ version: 2.6.3
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.6.0
40
+ version: 2.6.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-render
43
43
  requirement: !ruby/object:Gem::Requirement