metanorma-ietf 3.6.0 → 3.6.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/README.adoc +1 -1
- data/lib/isodoc/ietf/cleanup.rb +18 -0
- data/lib/isodoc/ietf/cleanup_blocks.rb +12 -4
- data/lib/isodoc/ietf/front.rb +5 -7
- data/lib/isodoc/ietf/metadata.rb +6 -0
- data/lib/metanorma/ietf/basicdoc.rng +6 -6
- data/lib/metanorma/ietf/isodoc.rng +8 -60
- data/lib/metanorma/ietf/version.rb +1 -1
- data/lib/relaton/render/config.yml +1 -1
- data/metanorma-ietf.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f0e7013a9c1c4dc1e68120b61238fbd30241630349e0c9b8f84b73c4b51eb59
|
4
|
+
data.tar.gz: eb27229d92af97141eaaaa446cd86bf70b28a06c9f35ef6da8e2535e696e6d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a59ffbbadc531aed8203951b6727c0eb9c9218e8826ceceb9578e9ab4b79775eaaa096fca3ee96bfcbfa3101e24384201c041b5a5769911d8f609cc76a15c74
|
7
|
+
data.tar.gz: 02146517cb6d24b14565e24424fcc191a8d64eae2dc985be127d9897474871b368c88844cf4b0e6c8a6b386ed0d73617ba4bef2a58854319dd3cf5db07fe4618
|
data/README.adoc
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
image:https://img.shields.io/gem/v/metanorma-ietf.svg["Gem Version", link="https://rubygems.org/gems/metanorma-ietf"]
|
8
8
|
image:https://github.com/metanorma/metanorma-ietf/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=rake"]
|
9
|
-
image:https://codeclimate.com/github/metanorma/metanorma-ietf/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-ietf"]
|
9
|
+
// image:https://codeclimate.com/github/metanorma/metanorma-ietf/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-ietf"]
|
10
10
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-ietf.svg["Pull Requests", link="https://github.com/metanorma/metanorma-ietf/pulls"]
|
11
11
|
image:https://img.shields.io/github/commits-since/metanorma/metanorma-ietf/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-ietf/releases"]
|
12
12
|
|
data/lib/isodoc/ietf/cleanup.rb
CHANGED
@@ -17,15 +17,27 @@ module IsoDoc
|
|
17
17
|
front_cleanup(docxml)
|
18
18
|
u_cleanup(docxml)
|
19
19
|
biblio_cleanup(docxml) # feeds aside
|
20
|
+
abstract_cleanup(docxml) # bleeds aside
|
20
21
|
aside_cleanup(docxml)
|
21
22
|
docxml
|
22
23
|
end
|
23
24
|
|
25
|
+
def abstract_cleanup(docxml)
|
26
|
+
docxml.xpath("//abstract").each do |a|
|
27
|
+
a.xpath(".//eref | .//xref").each do |node|
|
28
|
+
crossref_remove_markup_elem(node)
|
29
|
+
end
|
30
|
+
a.xpath(".//aside | ./title | .//table")
|
31
|
+
.each(&:remove)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
24
35
|
def biblio_cleanup(xmldoc)
|
25
36
|
biblio_referencegroup_cleanup(xmldoc)
|
26
37
|
biblio_abstract_cleanup(xmldoc)
|
27
38
|
biblio_date_cleanup(xmldoc)
|
28
39
|
biblio_refcontent_cleanup(xmldoc)
|
40
|
+
biblio_format_cleanup(xmldoc)
|
29
41
|
annotation_cleanup(xmldoc)
|
30
42
|
end
|
31
43
|
|
@@ -72,6 +84,12 @@ module IsoDoc
|
|
72
84
|
end
|
73
85
|
end
|
74
86
|
|
87
|
+
def biblio_format_cleanup(xmldoc)
|
88
|
+
xmldoc.xpath("//reference[format]").each do |r|
|
89
|
+
r.xpath("./format").each(&:remove)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
75
93
|
def reparse_abstract(abstract)
|
76
94
|
a1 = Nokogiri::XML(abstract.dup.to_xml
|
77
95
|
.sub("<abstract>", "<abstract xmlns='http://www.example.com'>")).root
|
@@ -109,20 +109,28 @@ module IsoDoc
|
|
109
109
|
def sourcecode_remove_markup(node)
|
110
110
|
node.traverse do |n|
|
111
111
|
n.text? and next
|
112
|
-
%w(name callout callout-annotation note
|
112
|
+
%w(name callout callout-annotation note
|
113
|
+
sourcecode).include? n.name and next
|
113
114
|
sourcecode_remove_markup_elem(n)
|
114
115
|
end
|
115
116
|
end
|
116
117
|
|
117
|
-
def
|
118
|
+
def crossref_remove_markup_elem(node)
|
118
119
|
case node.name
|
119
|
-
when "br" then node.replace("\n")
|
120
|
-
when "t" then node.replace("\n\n#{node.children}")
|
121
120
|
when "eref"
|
122
121
|
node.replace(node.children.empty? ? node["target"] : node.children)
|
123
122
|
when "xref"
|
124
123
|
node.children.empty? ? sourcecode_xref(node) : node.replace(node.children)
|
125
124
|
# when "relref" then n.replace(n.children.empty? ? n["target"] : n.children)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def sourcecode_remove_markup_elem(node)
|
129
|
+
case node.name
|
130
|
+
when "br" then node.replace("\n")
|
131
|
+
when "t" then node.replace("\n\n#{node.children}")
|
132
|
+
when "eref", "xref"
|
133
|
+
crossref_remove_markup_elem(node)
|
126
134
|
else node.replace(node.children)
|
127
135
|
end
|
128
136
|
end
|
data/lib/isodoc/ietf/front.rb
CHANGED
@@ -177,7 +177,8 @@ module IsoDoc
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def date(_isoxml, front)
|
180
|
-
date = @meta.get[:publisheddate] || @meta.get[:circulateddate] ||
|
180
|
+
date = @meta.get[:publisheddate] || @meta.get[:circulateddate] ||
|
181
|
+
Date.today.to_s
|
181
182
|
date = date.gsub(/T.*$/, "")
|
182
183
|
attr = date_attr(date) || return
|
183
184
|
front.date **attr_code(attr)
|
@@ -220,12 +221,8 @@ module IsoDoc
|
|
220
221
|
|
221
222
|
def abstract(isoxml, front)
|
222
223
|
a = isoxml.at(ns("//preface/abstract | //preface/foreword")) || return
|
223
|
-
front.abstract
|
224
|
-
a
|
225
|
-
%w(title note).include? c1.name
|
226
|
-
end.each do |c1|
|
227
|
-
parse(c1, abs)
|
228
|
-
end
|
224
|
+
front.abstract do |abs|
|
225
|
+
children_parse(a, abs)
|
229
226
|
end
|
230
227
|
end
|
231
228
|
|
@@ -239,6 +236,7 @@ module IsoDoc
|
|
239
236
|
a.children.reject { |c1| c1.name == "name" }.each do |c1|
|
240
237
|
parse(c1, n)
|
241
238
|
end
|
239
|
+
a.remove
|
242
240
|
end
|
243
241
|
end
|
244
242
|
|
data/lib/isodoc/ietf/metadata.rb
CHANGED
@@ -49,6 +49,12 @@ module IsoDoc
|
|
49
49
|
super
|
50
50
|
set(:doctype, "RFC") if get[:doctype].nil?
|
51
51
|
end
|
52
|
+
|
53
|
+
def initialize(lang, script, locale, i18n, fonts_options = {})
|
54
|
+
super
|
55
|
+
@metadata[:publisheddate] = nil
|
56
|
+
@metadata[:circulateddate] = nil
|
57
|
+
end
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
@@ -198,14 +198,14 @@ Applicable to modify and delete</a:documentation>
|
|
198
198
|
</zeroOrMore>
|
199
199
|
</element>
|
200
200
|
</optional>
|
201
|
-
<
|
201
|
+
<zeroOrMore>
|
202
202
|
<element name="description">
|
203
|
-
<a:documentation>Description of the change described in this block</a:documentation>
|
204
|
-
<
|
203
|
+
<a:documentation>Description(s) of the change described in this block</a:documentation>
|
204
|
+
<oneOrMore>
|
205
205
|
<ref name="BasicBlock"/>
|
206
|
-
</
|
206
|
+
</oneOrMore>
|
207
207
|
</element>
|
208
|
-
</
|
208
|
+
</zeroOrMore>
|
209
209
|
<optional>
|
210
210
|
<element name="newcontent">
|
211
211
|
<a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
|
@@ -1291,13 +1291,13 @@ Restricted recursively to contain only other such inline elements with no identi
|
|
1291
1291
|
<ref name="pure_strike"/>
|
1292
1292
|
<ref name="pure_smallcap"/>
|
1293
1293
|
<ref name="br"/>
|
1294
|
+
<ref name="stem"/>
|
1294
1295
|
</choice>
|
1295
1296
|
</define>
|
1296
1297
|
<define name="NestedTextElement">
|
1297
1298
|
<a:documentation>Contents of TextElement tags: leaves out tags that should occur only at top level of block: bookmark image hr pagebreak</a:documentation>
|
1298
1299
|
<choice>
|
1299
1300
|
<ref name="PureTextElement"/>
|
1300
|
-
<ref name="stem"/>
|
1301
1301
|
<ref name="eref"/>
|
1302
1302
|
<ref name="xref"/>
|
1303
1303
|
<ref name="hyperlink"/>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<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">
|
3
|
-
<!-- VERSION v2.0
|
3
|
+
<!-- VERSION v2.1.0 -->
|
4
4
|
|
5
5
|
<!--
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
@@ -42,36 +42,6 @@ All IdRefType instances point not to `@id` in Semantic XML, which is the Content
|
|
42
42
|
but to `@anchor`, the user-supplied cross-reference</a:documentation>
|
43
43
|
<text/>
|
44
44
|
</define>
|
45
|
-
<define name="index-primary">
|
46
|
-
<element name="primary">
|
47
|
-
<oneOrMore>
|
48
|
-
<choice>
|
49
|
-
<ref name="PureTextElement"/>
|
50
|
-
<ref name="stem"/>
|
51
|
-
</choice>
|
52
|
-
</oneOrMore>
|
53
|
-
</element>
|
54
|
-
</define>
|
55
|
-
<define name="index-secondary">
|
56
|
-
<element name="secondary">
|
57
|
-
<oneOrMore>
|
58
|
-
<choice>
|
59
|
-
<ref name="PureTextElement"/>
|
60
|
-
<ref name="stem"/>
|
61
|
-
</choice>
|
62
|
-
</oneOrMore>
|
63
|
-
</element>
|
64
|
-
</define>
|
65
|
-
<define name="index-tertiary">
|
66
|
-
<element name="tertiary">
|
67
|
-
<oneOrMore>
|
68
|
-
<choice>
|
69
|
-
<ref name="PureTextElement"/>
|
70
|
-
<ref name="stem"/>
|
71
|
-
</choice>
|
72
|
-
</oneOrMore>
|
73
|
-
</element>
|
74
|
-
</define>
|
75
45
|
<define name="review">
|
76
46
|
<a:documentation>Generalise BasicDoc element from just review comments, to general annotations;
|
77
47
|
the type attribute defaults to `review` for reviews</a:documentation>
|
@@ -592,28 +562,6 @@ normative or informative references, some split references into sections organiz
|
|
592
562
|
</oneOrMore>
|
593
563
|
</element>
|
594
564
|
</define>
|
595
|
-
<define name="sub">
|
596
|
-
<a:documentation>Subscript text. Corresponds to HTML `sub</a:documentation>
|
597
|
-
<element name="sub">
|
598
|
-
<zeroOrMore>
|
599
|
-
<choice>
|
600
|
-
<ref name="PureTextElement"/>
|
601
|
-
<ref name="stem"/>
|
602
|
-
</choice>
|
603
|
-
</zeroOrMore>
|
604
|
-
</element>
|
605
|
-
</define>
|
606
|
-
<define name="sup">
|
607
|
-
<a:documentation>Superscript text. Corresponds to HTML `sup`</a:documentation>
|
608
|
-
<element name="sup">
|
609
|
-
<zeroOrMore>
|
610
|
-
<choice>
|
611
|
-
<ref name="PureTextElement"/>
|
612
|
-
<ref name="stem"/>
|
613
|
-
</choice>
|
614
|
-
</zeroOrMore>
|
615
|
-
</element>
|
616
|
-
</define>
|
617
565
|
<define name="pagebreak">
|
618
566
|
<a:documentation>Page break. Only applicable in paged layouts (e.g. PDF, Word), and not flow layouts (e.g. HTML)</a:documentation>
|
619
567
|
<element name="pagebreak">
|
@@ -735,6 +683,12 @@ titlecase, or lowercase</a:documentation>
|
|
735
683
|
<ref name="BlockAttributes"/>
|
736
684
|
</define>
|
737
685
|
<define name="TableAttributes" combine="interleave">
|
686
|
+
<optional>
|
687
|
+
<attribute name="plain">
|
688
|
+
<a:documentation>Render as a plain attribute, with no shading or borders</a:documentation>
|
689
|
+
<data type="boolean"/>
|
690
|
+
</attribute>
|
691
|
+
</optional>
|
738
692
|
<optional>
|
739
693
|
<attribute name="width">
|
740
694
|
<a:documentation>Width of the table block in rendering</a:documentation>
|
@@ -1088,7 +1042,6 @@ That concept may be defined as a term within the current document, or it may be
|
|
1088
1042
|
<zeroOrMore>
|
1089
1043
|
<choice>
|
1090
1044
|
<ref name="PureTextElement"/>
|
1091
|
-
<ref name="stem"/>
|
1092
1045
|
<ref name="index"/>
|
1093
1046
|
<ref name="index-xref"/>
|
1094
1047
|
</choice>
|
@@ -1101,7 +1054,6 @@ That concept may be defined as a term within the current document, or it may be
|
|
1101
1054
|
<zeroOrMore>
|
1102
1055
|
<choice>
|
1103
1056
|
<ref name="PureTextElement"/>
|
1104
|
-
<ref name="stem"/>
|
1105
1057
|
<ref name="index"/>
|
1106
1058
|
<ref name="index-xref"/>
|
1107
1059
|
</choice>
|
@@ -2019,10 +1971,7 @@ used in document amendments</a:documentation>
|
|
2019
1971
|
<element name="name">
|
2020
1972
|
<a:documentation>The symbolic form of the designation</a:documentation>
|
2021
1973
|
<oneOrMore>
|
2022
|
-
<
|
2023
|
-
<ref name="PureTextElement"/>
|
2024
|
-
<ref name="stem"/>
|
2025
|
-
</choice>
|
1974
|
+
<ref name="PureTextElement"/>
|
2026
1975
|
</oneOrMore>
|
2027
1976
|
</element>
|
2028
1977
|
</element>
|
@@ -2075,7 +2024,6 @@ used in document amendments</a:documentation>
|
|
2075
2024
|
<zeroOrMore>
|
2076
2025
|
<choice>
|
2077
2026
|
<ref name="PureTextElement"/>
|
2078
|
-
<ref name="stem"/>
|
2079
2027
|
<ref name="index"/>
|
2080
2028
|
<ref name="index-xref"/>
|
2081
2029
|
</choice>
|
@@ -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> {
|
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' | 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> {{ 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 %}"
|
24
24
|
website: standard
|
25
25
|
book: standard
|
26
26
|
booklet: standard
|
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 "
|
54
|
+
spec.add_development_dependency "canon"
|
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.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: 2025-
|
11
|
+
date: 2025-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-ietf-data
|
@@ -207,7 +207,7 @@ dependencies:
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
210
|
+
name: canon
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
213
|
- - ">="
|