metanorma-ietf 3.6.4 → 3.6.5
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/cleanup.rb +6 -1
- data/lib/isodoc/ietf/front.rb +5 -4
- data/lib/isodoc/ietf/inline.rb +1 -0
- data/lib/isodoc/ietf/metadata.rb +4 -2
- data/lib/isodoc/ietf/references.rb +21 -9
- data/lib/metanorma/ietf/biblio.rng +1 -1
- data/lib/metanorma/ietf/ietf.rng +3 -3
- data/lib/metanorma/ietf/isodoc.rng +35 -10
- data/lib/metanorma/ietf/version.rb +1 -1
- data/lib/relaton/render/config.yml +1 -1
- data/lib/relaton/render/parse.rb +1 -1
- data/metanorma-ietf.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb5758828f2f98a205b8195c990f58e1bf21bd90f8031df7d71a3757588952cc
|
4
|
+
data.tar.gz: f8dec2d352999ed8a0524c61a1850385987a03c7addd5648d1ff8886e4aae4c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4ca63eaaee7f005f29a8e318ed527a71fca533e6f8ede4da6ff4e1bb66331ded6bc90640ea133e061093ef7440f915753173563f9d7e606df85d7d6c37c1a6
|
7
|
+
data.tar.gz: 59e80f4b00c89ceb6b70364abea4e0b26d1f40a59bf0d222f283667da93674ce6bbd8f6b127e0e9b0852656809464ac2cd9b53065438a677f5045fb291ac6e57
|
data/lib/isodoc/ietf/cleanup.rb
CHANGED
@@ -99,7 +99,12 @@ module IsoDoc
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def front_cleanup(xmldoc)
|
102
|
-
xmldoc.xpath("//title").each
|
102
|
+
xmldoc.xpath("//title").each do |s|
|
103
|
+
s.xpath(".//eref[normalize-space(.)='']").each do |e|
|
104
|
+
e.replace(e["target"])
|
105
|
+
end
|
106
|
+
s.children = s.text
|
107
|
+
end
|
103
108
|
xmldoc.xpath("//reference/front[not(author)]").each do |f|
|
104
109
|
insert = f.at("./seriesInfo[last()]") || f.at("./title")
|
105
110
|
insert.next = "<author surname='Unknown'/>"
|
data/lib/isodoc/ietf/front.rb
CHANGED
@@ -72,7 +72,8 @@ module IsoDoc
|
|
72
72
|
isoxml.xpath("//xmlns:bibdata/xmlns:contributor[xmlns:role/@type = " \
|
73
73
|
"'author' or xmlns:role/@type = 'editor']").each do |c|
|
74
74
|
role = c.at(ns("./role/@type")).text == "editor" ? "editor" : nil
|
75
|
-
|
75
|
+
c.at(ns("./organization/subdivision[@type = 'Workgroup']")) and next
|
76
|
+
(c.at(ns("./organization")) and org_author(c, role, front)) or
|
76
77
|
person_author(c, role, front)
|
77
78
|
end
|
78
79
|
end
|
@@ -104,7 +105,7 @@ module IsoDoc
|
|
104
105
|
front.author **attrs do |a|
|
105
106
|
org = contrib.at(ns("./person/affiliation/organization")) and
|
106
107
|
organization(org, a, contrib.document.at(ns("//showOnFrontPage")))
|
107
|
-
address(contrib.
|
108
|
+
address(contrib.at(ns(".//address")),
|
108
109
|
contrib.at(ns(".//phone[not(@type = 'fax')]")),
|
109
110
|
contrib.at(ns(".//phone[@type = 'fax']")),
|
110
111
|
contrib.xpath(ns(".//email")), contrib.at(ns(".//uri")), a)
|
@@ -126,13 +127,13 @@ module IsoDoc
|
|
126
127
|
name = org.at(ns("./name"))&.text
|
127
128
|
out.organization name, **attr_code(
|
128
129
|
showOnFrontPage: show&.text, ascii: output_if_translit(name),
|
129
|
-
asciiAbbrev: output_if_translit(org.at(ns("./abbreviation"))),
|
130
|
+
asciiAbbrev: output_if_translit(org.at(ns("./abbreviation"))&.text),
|
130
131
|
abbrev: org.at(ns("./abbreviation"))
|
131
132
|
)
|
132
133
|
end
|
133
134
|
|
134
135
|
def address(addr, phone, fax, email, uri, out)
|
135
|
-
return unless addr || phone || fax || email || uri
|
136
|
+
return unless addr || phone || fax || !email.empty? || uri
|
136
137
|
|
137
138
|
out.address do |a|
|
138
139
|
addr and postal(addr, a)
|
data/lib/isodoc/ietf/inline.rb
CHANGED
data/lib/isodoc/ietf/metadata.rb
CHANGED
@@ -29,7 +29,8 @@ module IsoDoc
|
|
29
29
|
|
30
30
|
def docid(isoxml, _out)
|
31
31
|
dn = isoxml.at(ns("//bibdata/docnumber"))
|
32
|
-
set(:docnumber, dn&.text&.sub(/^rfc-/, "")
|
32
|
+
set(:docnumber, dn&.text&.strip&.sub(/^rfc-/, "")
|
33
|
+
&.sub(/\.[a-z0-9]+$/i, ""))
|
33
34
|
end
|
34
35
|
|
35
36
|
def author(xml, _out)
|
@@ -39,7 +40,8 @@ module IsoDoc
|
|
39
40
|
|
40
41
|
def wg(xml)
|
41
42
|
workgroups = []
|
42
|
-
xml.xpath(ns("//bibdata/
|
43
|
+
xml.xpath(ns("//bibdata/contributor[role/description = 'committee']/" \
|
44
|
+
"organization/subdivision[@type = 'Workgroup']/name")).each do |wg|
|
43
45
|
workgroups << wg.text
|
44
46
|
end
|
45
47
|
set(:wg, workgroups)
|
@@ -29,9 +29,7 @@ module IsoDoc
|
|
29
29
|
|
30
30
|
def bibliography1(node, out)
|
31
31
|
out.references **attr_code(anchor: node["id"]) do |div|
|
32
|
-
|
33
|
-
title.children.each { |n| parse(n, name) }
|
34
|
-
end
|
32
|
+
bibliography1_title(node, div)
|
35
33
|
node.elements.select do |e|
|
36
34
|
%w(references clause).include? e.name
|
37
35
|
end.each { |e| bibliography1(e, out) }
|
@@ -42,6 +40,12 @@ module IsoDoc
|
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
43
|
+
def bibliography1_title(node, div)
|
44
|
+
title = node.at(ns("./title")) and div.name do |name|
|
45
|
+
title.children.each { |n| parse(n, name) }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
45
49
|
def biblio_list(node, div, _biblio)
|
46
50
|
i = 0
|
47
51
|
node.xpath(ns("./bibitem | ./note")).each do |b|
|
@@ -66,15 +70,23 @@ module IsoDoc
|
|
66
70
|
end
|
67
71
|
|
68
72
|
def bibitem_render(ref, bib)
|
73
|
+
bib1 = bibitem_render_prep(bib)
|
74
|
+
if (f = bib1.at(ns("./formattedref"))) && !bib1.at(ns("./title"))
|
75
|
+
ref.front do |front|
|
76
|
+
front.title do |t|
|
77
|
+
children_parse(f, t)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
else
|
81
|
+
ref << @bibrenderer.render(bib1.to_xml, embedded: true)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def bibitem_render_prep(bib)
|
69
86
|
bib1 = bib.clone
|
70
87
|
@isodoc.prep_for_rendering(bib1)
|
71
88
|
bib1.namespace = nil
|
72
|
-
|
73
|
-
ref << if bib1.at(ns("./formattedref")) && !bib1.at(ns("./title"))
|
74
|
-
"<front><title>#{ret}</title></front>"
|
75
|
-
else
|
76
|
-
ret
|
77
|
-
end
|
89
|
+
bib1
|
78
90
|
end
|
79
91
|
end
|
80
92
|
end
|
@@ -869,7 +869,7 @@ depending on whether the items exist as independent documents, or are parts of a
|
|
869
869
|
</zeroOrMore>
|
870
870
|
</element>
|
871
871
|
</define>
|
872
|
-
<define name="BibItemType"
|
872
|
+
<define name="BibItemType">
|
873
873
|
<a:documentation>Type of bibliographic item.
|
874
874
|
The value list complies with the types provided in ISO 690:2021.
|
875
875
|
NOTE: These values represent a strict superset to BibTeX
|
data/lib/metanorma/ietf/ietf.rng
CHANGED
@@ -259,11 +259,11 @@
|
|
259
259
|
<ref name="index-tertiary"/>
|
260
260
|
</element>
|
261
261
|
</define>
|
262
|
-
<define name="TextElement" combine="choice">
|
263
|
-
<ref name="review"/>
|
264
|
-
</define>
|
265
262
|
</include>
|
266
263
|
<!-- end overrides -->
|
264
|
+
<define name="TextElement" combine="choice">
|
265
|
+
<ref name="review"/>
|
266
|
+
</define>
|
267
267
|
<define name="ReviewAttributes" combine="interleave">
|
268
268
|
<optional>
|
269
269
|
<attribute name="display"/>
|
@@ -311,17 +311,28 @@ and is intended to be referenced by a callout within the source code</a:document
|
|
311
311
|
</ref>
|
312
312
|
</optional>
|
313
313
|
<choice>
|
314
|
-
<a:documentation>Content of the figure</a:documentation>
|
315
|
-
<ref name="image"
|
314
|
+
<a:documentation>Content of the figure </a:documentation>
|
315
|
+
<ref name="image">
|
316
|
+
<a:documentation>by default the content of a figure is a media file</a:documentation>
|
317
|
+
</ref>
|
316
318
|
<ref name="video"/>
|
317
319
|
<ref name="audio"/>
|
318
|
-
<ref name="pre"
|
320
|
+
<ref name="pre">
|
321
|
+
<a:documentation>figures can contain ASCII art</a:documentation>
|
322
|
+
</ref>
|
319
323
|
<oneOrMore>
|
320
|
-
<ref name="paragraph-with-footnote"
|
324
|
+
<ref name="paragraph-with-footnote">
|
325
|
+
<a:documentation>figures can contain discursive art</a:documentation>
|
326
|
+
</ref>
|
321
327
|
</oneOrMore>
|
322
328
|
<zeroOrMore>
|
323
|
-
<ref name="figure"
|
329
|
+
<ref name="figure">
|
330
|
+
<a:documentation>subfigures, nested directly within a figure</a:documentation>
|
331
|
+
</ref>
|
324
332
|
</zeroOrMore>
|
333
|
+
<ref name="table">
|
334
|
+
<a:documentation>Table is understood in this context to be a tabular arrangement of subfigures</a:documentation>
|
335
|
+
</ref>
|
325
336
|
</choice>
|
326
337
|
<zeroOrMore>
|
327
338
|
<ref name="fn">
|
@@ -354,17 +365,28 @@ and is intended to be referenced by a callout within the source code</a:document
|
|
354
365
|
</ref>
|
355
366
|
</optional>
|
356
367
|
<choice>
|
357
|
-
<a:documentation>Content of the figure</a:documentation>
|
358
|
-
<ref name="image-no-id"
|
368
|
+
<a:documentation>Content of the figure </a:documentation>
|
369
|
+
<ref name="image-no-id">
|
370
|
+
<a:documentation>by default the content of a figure is a media file</a:documentation>
|
371
|
+
</ref>
|
359
372
|
<ref name="video-no-id"/>
|
360
373
|
<ref name="audio-no-id"/>
|
361
|
-
<ref name="pre-no-id"
|
374
|
+
<ref name="pre-no-id">
|
375
|
+
<a:documentation>figures can contain ASCII art</a:documentation>
|
376
|
+
</ref>
|
362
377
|
<oneOrMore>
|
363
|
-
<ref name="paragraph-with-footnote-no-id"
|
378
|
+
<ref name="paragraph-with-footnote-no-id">
|
379
|
+
<a:documentation>figures can contain discursive art</a:documentation>
|
380
|
+
</ref>
|
364
381
|
</oneOrMore>
|
365
382
|
<zeroOrMore>
|
366
|
-
<ref name="figure-no-id"
|
383
|
+
<ref name="figure-no-id">
|
384
|
+
<a:documentation>subfigures, nested directly within a figure</a:documentation>
|
385
|
+
</ref>
|
367
386
|
</zeroOrMore>
|
387
|
+
<ref name="table-no-id">
|
388
|
+
<a:documentation>Table is understood in this context to be a tabular arrangement of subfigures</a:documentation>
|
389
|
+
</ref>
|
368
390
|
</choice>
|
369
391
|
<zeroOrMore>
|
370
392
|
<ref name="fn">
|
@@ -876,6 +898,9 @@ titlecase, or lowercase</a:documentation>
|
|
876
898
|
<data type="boolean"/>
|
877
899
|
</attribute>
|
878
900
|
</optional>
|
901
|
+
<ref name="LocalizedStringAttributes">
|
902
|
+
<a:documentation>Specify language of bibitem, can be used to render it with language-specific bibliographic style</a:documentation>
|
903
|
+
</ref>
|
879
904
|
<ref name="ReducedBibliographicItem"/>
|
880
905
|
</element>
|
881
906
|
</define>
|
@@ -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> {{ series }} {%for d in doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' |
|
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> {{ series }} {%for d in doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | replace: '<esc> ': '<esc>' | replace: ' </esc>' : '</esc>' }}'_name='DOI'/>{% endfor %} {% if home_standard %}{% for j in authoritative_identifier %} <seriesInfo_value='{{ j | replace: ' ', ' ' | replace: '<esc> ': '<esc>' | replace: ' </esc>' : '</esc>' | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if j contains 'I-D.'%}Internet-Draft{% else %}{{ j | replace: ' ', ' ' | replace: '<esc> ': '<esc>' | replace: ' </esc>' : '</esc>' | 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> {{ series }} {%for d in i.doi %}<seriesInfo_value='{{ d | replace: ' ', ' ' | remove_first: 'DOI' | replace: '<esc> ': '<esc>' | replace: ' </esc>' : '</esc>' }}'_name='DOI'/>{% endfor %} {% if home_standard %}{% for j in i.authoritative_identifier %} <seriesInfo_value='{{ j | replace: ' ', ' ' | replace: '<esc> ': '<esc>' | replace: ' </esc>' : '</esc>' | split: ' ' | last | remove_first: 'I-D.'}}'_name='{%if j contains 'I-D.'%}Internet-Draft{% else %}{{ j | replace: ' ', ' ' | replace: '<esc> ': '<esc>' | replace: ' </esc>' : '</esc>' | 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
|
data/lib/relaton/render/parse.rb
CHANGED
@@ -99,7 +99,7 @@ module Relaton
|
|
99
99
|
%w(BCP STD).include?(s.title.title.content)
|
100
100
|
end
|
101
101
|
bcp and ret.unshift("BCP #{bcp.number}")
|
102
|
-
ret.reject { |x|
|
102
|
+
ret.reject { |x| /(rfc-anchor|Internet-Draft)/.match? (x) }
|
103
103
|
end
|
104
104
|
|
105
105
|
def simple_xml2hash(doc)
|
data/metanorma-ietf.gemspec
CHANGED
@@ -51,5 +51,5 @@ spec.add_development_dependency "rubocop-performance"
|
|
51
51
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
52
52
|
spec.add_development_dependency "timecop", "~> 0.9"
|
53
53
|
spec.add_development_dependency "webmock"
|
54
|
-
spec.add_development_dependency "canon"
|
54
|
+
spec.add_development_dependency "canon", "= 0.1.3"
|
55
55
|
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.6.
|
4
|
+
version: 3.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-ietf-data
|
@@ -210,16 +210,16 @@ dependencies:
|
|
210
210
|
name: canon
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- -
|
213
|
+
- - '='
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: 0.1.3
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- -
|
220
|
+
- - '='
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
222
|
+
version: 0.1.3
|
223
223
|
description: |
|
224
224
|
metanorma-ietf lets you write IETF documents, such as Internet-Drafts and RFCs,
|
225
225
|
in native AsciiDoc syntax. This is part of the Metanorma publishing framework.
|