metanorma-ietf 3.0.4 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ietf/blocks.rb +9 -0
- data/lib/isodoc/ietf/i18n.rb +1 -1
- data/lib/isodoc/ietf/init.rb +1 -1
- data/lib/isodoc/ietf/references.rb +0 -13
- data/lib/metanorma/ietf/biblio.rng +94 -44
- data/lib/metanorma/ietf/blocks.rb +16 -14
- data/lib/metanorma/ietf/cleanup.rb +0 -16
- data/lib/metanorma/ietf/converter.rb +1 -1
- data/lib/metanorma/ietf/isodoc.rng +65 -0
- data/lib/metanorma/ietf/version.rb +1 -1
- data/metanorma-ietf.gemspec +1 -1
- metadata +5 -8
- data/docs/installation.md +0 -21
- data/docs/navigation.md +0 -7
- data/docs/overview.md +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9f8258cd56113e10722ce8677d62aa22766c25b74676c0cca588bdce4e42974
|
4
|
+
data.tar.gz: 5353aca20fb71c85372b76d1ca7e34d3927944e69baeba30e4964fe2faa73d48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 377cdab4b95054f519d409e5987f33d1d37aae27520f60cdbe59761a3efe6b2d4f7306657eeaba2ff4431ee18f81f7c98215de76b9cb81a87b9984a1b1126d06
|
7
|
+
data.tar.gz: 90704e85d696d404bda87daf06b710f8656d6c3867286f657ddc5b99315a5c9984b262363a19838b0d469f8f47ae3320675c9cd570de8e22d9ff10b94d6f99f6
|
data/lib/isodoc/ietf/blocks.rb
CHANGED
@@ -179,6 +179,15 @@ module IsoDoc
|
|
179
179
|
end
|
180
180
|
end
|
181
181
|
|
182
|
+
def admonition_name(node, type)
|
183
|
+
name = node&.at(ns("./name")) and return name
|
184
|
+
name = Nokogiri::XML::Node.new("name", node.document)
|
185
|
+
return unless type && @i18n.admonition[type]
|
186
|
+
|
187
|
+
name << @i18n.admonition[type]&.upcase
|
188
|
+
name
|
189
|
+
end
|
190
|
+
|
182
191
|
def admonition_name_parse(_node, div, name)
|
183
192
|
div.t **{ keepWithNext: "true" } do |p|
|
184
193
|
name.children.each { |n| parse(n, p) }
|
data/lib/isodoc/ietf/i18n.rb
CHANGED
data/lib/isodoc/ietf/init.rb
CHANGED
@@ -38,7 +38,6 @@ module IsoDoc
|
|
38
38
|
|
39
39
|
i += 1 if b.name == "bibitem"
|
40
40
|
if b.name == "note" then note_parse(b, div)
|
41
|
-
elsif ietf?(b) then ietf_bibitem_entry(div, b, i)
|
42
41
|
else
|
43
42
|
nonstd_bibitem(div, b, i, biblio)
|
44
43
|
end
|
@@ -171,18 +170,6 @@ module IsoDoc
|
|
171
170
|
end
|
172
171
|
end
|
173
172
|
end
|
174
|
-
|
175
|
-
def ietf_bibitem_entry(div, bib, _idx)
|
176
|
-
url = bib&.at(ns("./uri[@type = 'xml']"))&.text
|
177
|
-
div << "<xi:include href='#{url}'/>"
|
178
|
-
end
|
179
|
-
|
180
|
-
def ietf?(bib)
|
181
|
-
return false if !@xinclude
|
182
|
-
|
183
|
-
url = bib.at(ns("./uri[@type = 'xml']")) or return false
|
184
|
-
/xml2rfc\.tools\.ietf\.org/.match(url)
|
185
|
-
end
|
186
173
|
end
|
187
174
|
end
|
188
175
|
end
|
@@ -527,7 +527,7 @@
|
|
527
527
|
</define>
|
528
528
|
<define name="LocalityType">
|
529
529
|
<data type="string">
|
530
|
-
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
530
|
+
<param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
531
531
|
</data>
|
532
532
|
</define>
|
533
533
|
<define name="referenceFrom">
|
@@ -614,12 +614,12 @@
|
|
614
614
|
<optional>
|
615
615
|
<ref name="fetched"/>
|
616
616
|
</optional>
|
617
|
-
<
|
618
|
-
<oneOrMore>
|
619
|
-
<ref name="btitle"/>
|
620
|
-
</oneOrMore>
|
617
|
+
<optional>
|
621
618
|
<ref name="formattedref"/>
|
622
|
-
</
|
619
|
+
</optional>
|
620
|
+
<oneOrMore>
|
621
|
+
<ref name="btitle"/>
|
622
|
+
</oneOrMore>
|
623
623
|
<zeroOrMore>
|
624
624
|
<ref name="bsource"/>
|
625
625
|
</zeroOrMore>
|
@@ -677,6 +677,9 @@
|
|
677
677
|
<zeroOrMore>
|
678
678
|
<ref name="extent"/>
|
679
679
|
</zeroOrMore>
|
680
|
+
<optional>
|
681
|
+
<ref name="bibliographic_size"/>
|
682
|
+
</optional>
|
680
683
|
<zeroOrMore>
|
681
684
|
<ref name="accesslocation"/>
|
682
685
|
</zeroOrMore>
|
@@ -848,17 +851,46 @@
|
|
848
851
|
</define>
|
849
852
|
<define name="bplace">
|
850
853
|
<element name="place">
|
851
|
-
<
|
852
|
-
<
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
854
|
+
<choice>
|
855
|
+
<text/>
|
856
|
+
<group>
|
857
|
+
<ref name="bibliocity"/>
|
858
|
+
<zeroOrMore>
|
859
|
+
<ref name="biblioregion"/>
|
860
|
+
</zeroOrMore>
|
861
|
+
<zeroOrMore>
|
862
|
+
<ref name="bibliocountry"/>
|
863
|
+
</zeroOrMore>
|
864
|
+
</group>
|
865
|
+
</choice>
|
866
|
+
</element>
|
867
|
+
</define>
|
868
|
+
<define name="bibliocity">
|
869
|
+
<element name="city">
|
859
870
|
<text/>
|
860
871
|
</element>
|
861
872
|
</define>
|
873
|
+
<define name="biblioregion">
|
874
|
+
<element name="region">
|
875
|
+
<ref name="RegionType"/>
|
876
|
+
</element>
|
877
|
+
</define>
|
878
|
+
<define name="bibliocountry">
|
879
|
+
<element name="country">
|
880
|
+
<ref name="RegionType"/>
|
881
|
+
</element>
|
882
|
+
</define>
|
883
|
+
<define name="RegionType">
|
884
|
+
<optional>
|
885
|
+
<attribute name="iso"/>
|
886
|
+
</optional>
|
887
|
+
<optional>
|
888
|
+
<attribute name="recommended">
|
889
|
+
<data type="boolean"/>
|
890
|
+
</attribute>
|
891
|
+
</optional>
|
892
|
+
<text/>
|
893
|
+
</define>
|
862
894
|
<define name="bprice">
|
863
895
|
<element name="price">
|
864
896
|
<attribute name="currency"/>
|
@@ -922,9 +954,29 @@
|
|
922
954
|
<text/>
|
923
955
|
</element>
|
924
956
|
</define>
|
957
|
+
<define name="sizevalue">
|
958
|
+
<element name="value">
|
959
|
+
<attribute name="type"/>
|
960
|
+
<text/>
|
961
|
+
</element>
|
962
|
+
</define>
|
963
|
+
<define name="bibliographic_size">
|
964
|
+
<element name="size">
|
965
|
+
<oneOrMore>
|
966
|
+
<ref name="sizevalue"/>
|
967
|
+
</oneOrMore>
|
968
|
+
</element>
|
969
|
+
</define>
|
925
970
|
<define name="extent">
|
926
971
|
<element name="extent">
|
927
|
-
<
|
972
|
+
<choice>
|
973
|
+
<zeroOrMore>
|
974
|
+
<ref name="locality"/>
|
975
|
+
</zeroOrMore>
|
976
|
+
<zeroOrMore>
|
977
|
+
<ref name="localityStack"/>
|
978
|
+
</zeroOrMore>
|
979
|
+
</choice>
|
928
980
|
</element>
|
929
981
|
</define>
|
930
982
|
<define name="series">
|
@@ -934,36 +986,34 @@
|
|
934
986
|
<ref name="SeriesType"/>
|
935
987
|
</attribute>
|
936
988
|
</optional>
|
937
|
-
<
|
989
|
+
<optional>
|
938
990
|
<ref name="formattedref"/>
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
</group>
|
966
|
-
</choice>
|
991
|
+
</optional>
|
992
|
+
<ref name="btitle"/>
|
993
|
+
<optional>
|
994
|
+
<ref name="bplace"/>
|
995
|
+
</optional>
|
996
|
+
<optional>
|
997
|
+
<ref name="seriesorganization"/>
|
998
|
+
</optional>
|
999
|
+
<optional>
|
1000
|
+
<ref name="abbreviation"/>
|
1001
|
+
</optional>
|
1002
|
+
<optional>
|
1003
|
+
<ref name="seriesfrom"/>
|
1004
|
+
</optional>
|
1005
|
+
<optional>
|
1006
|
+
<ref name="seriesto"/>
|
1007
|
+
</optional>
|
1008
|
+
<optional>
|
1009
|
+
<ref name="seriesnumber"/>
|
1010
|
+
</optional>
|
1011
|
+
<optional>
|
1012
|
+
<ref name="seriespartnumber"/>
|
1013
|
+
</optional>
|
1014
|
+
<optional>
|
1015
|
+
<ref name="seriesrun"/>
|
1016
|
+
</optional>
|
967
1017
|
</element>
|
968
1018
|
</define>
|
969
1019
|
<define name="SeriesType">
|
@@ -2,10 +2,10 @@ module Metanorma
|
|
2
2
|
module Ietf
|
3
3
|
class Converter < ::Metanorma::Standoc::Converter
|
4
4
|
def para_attrs(node)
|
5
|
-
attr_code(
|
5
|
+
attr_code("keep-with-next": node.attr("keepWithNext") ||
|
6
6
|
node.attr("keep-with-next"),
|
7
7
|
"keep-with-previous": node.attr("keepWithPrevious") ||
|
8
|
-
|
8
|
+
node.attr("keep-with-previous"),
|
9
9
|
id: ::Metanorma::Utils::anchor_or_uuid(node))
|
10
10
|
end
|
11
11
|
|
@@ -36,20 +36,21 @@ module Metanorma
|
|
36
36
|
|
37
37
|
def sidebar(node)
|
38
38
|
return unless draft?
|
39
|
+
|
39
40
|
noko do |xml|
|
40
|
-
xml.review **
|
41
|
+
xml.review **sidebar_attrs(node) do |r|
|
41
42
|
node.title.nil? or r.name { |name| name << node.title }
|
42
43
|
wrap_in_para(node, r)
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
|
-
def note(
|
48
|
+
def note(node)
|
48
49
|
noko do |xml|
|
49
|
-
xml.note **attr_code(id: ::Metanorma::Utils::anchor_or_uuid(
|
50
|
-
removeInRFC:
|
51
|
-
|
52
|
-
wrap_in_para(
|
50
|
+
xml.note **attr_code(id: ::Metanorma::Utils::anchor_or_uuid(nil),
|
51
|
+
removeInRFC: node.attr("remove-in-rfc")) do |c|
|
52
|
+
node.title.nil? or c.name { |name| name << node.title }
|
53
|
+
wrap_in_para(node, c)
|
53
54
|
end
|
54
55
|
end.join("\n")
|
55
56
|
end
|
@@ -59,9 +60,9 @@ module Metanorma
|
|
59
60
|
xml.figure **literal_attrs(node) do |f|
|
60
61
|
figure_title(node, f)
|
61
62
|
f.pre node.lines.join("\n"),
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
**attr_code(align: node.attr("align"),
|
64
|
+
id: ::Metanorma::Utils::anchor_or_uuid(nil),
|
65
|
+
alt: node.attr("alt"))
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
@@ -70,9 +71,10 @@ module Metanorma
|
|
70
71
|
super.merge(attr_code(align: node.attr("align")))
|
71
72
|
end
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
def listing_attrs(node)
|
75
|
+
super.merge(attr_code(markers: node.attr("markers"),
|
76
|
+
src: node.attr("src")))
|
77
|
+
end
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
@@ -5,7 +5,6 @@ module Metanorma
|
|
5
5
|
bcp14_cleanup(xmldoc)
|
6
6
|
abstract_cleanup(xmldoc)
|
7
7
|
super
|
8
|
-
rfc_anchor_cleanup(xmldoc)
|
9
8
|
cref_cleanup(xmldoc)
|
10
9
|
xmldoc
|
11
10
|
end
|
@@ -42,21 +41,6 @@ module Metanorma
|
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
45
|
-
def rfc_anchor_cleanup(xml)
|
46
|
-
map = xml.xpath("//bibitem[docidentifier[@type = 'IETF' or @type = 'RFC']"\
|
47
|
-
"[@scope = 'anchor']]").each_with_object({}) do |b, m|
|
48
|
-
next if b.at("./ancestor::bibdata | ./ancestor::bibitem")
|
49
|
-
|
50
|
-
id = b.at("./docidentifier[@type = 'IETF' or @type = 'RFC'][@scope = 'anchor']").text
|
51
|
-
m[b["id"]] = id
|
52
|
-
b["id"] = id
|
53
|
-
end
|
54
|
-
xml.xpath("//eref | //origin").each do |x|
|
55
|
-
map[x["bibitemid"]] and x["bibitemid"] = map[x["bibitemid"]]
|
56
|
-
end
|
57
|
-
xml
|
58
|
-
end
|
59
|
-
|
60
44
|
def smartquotes_cleanup(xmldoc)
|
61
45
|
xmldoc.traverse do |n|
|
62
46
|
next unless n.text?
|
@@ -32,6 +32,43 @@
|
|
32
32
|
<ref name="DocumentType"/>
|
33
33
|
</element>
|
34
34
|
</define>
|
35
|
+
<define name="admonition">
|
36
|
+
<element name="admonition">
|
37
|
+
<attribute name="type">
|
38
|
+
<ref name="AdmonitionType"/>
|
39
|
+
</attribute>
|
40
|
+
<optional>
|
41
|
+
<attribute name="class"/>
|
42
|
+
</optional>
|
43
|
+
<attribute name="id">
|
44
|
+
<data type="ID"/>
|
45
|
+
</attribute>
|
46
|
+
<optional>
|
47
|
+
<attribute name="uri">
|
48
|
+
<data type="anyURI"/>
|
49
|
+
</attribute>
|
50
|
+
</optional>
|
51
|
+
<optional>
|
52
|
+
<attribute name="coverpage">
|
53
|
+
<data type="boolean"/>
|
54
|
+
</attribute>
|
55
|
+
</optional>
|
56
|
+
<optional>
|
57
|
+
<attribute name="notag">
|
58
|
+
<data type="boolean"/>
|
59
|
+
</attribute>
|
60
|
+
</optional>
|
61
|
+
<optional>
|
62
|
+
<ref name="tname"/>
|
63
|
+
</optional>
|
64
|
+
<zeroOrMore>
|
65
|
+
<ref name="paragraph-with-footnote"/>
|
66
|
+
</zeroOrMore>
|
67
|
+
<zeroOrMore>
|
68
|
+
<ref name="note"/>
|
69
|
+
</zeroOrMore>
|
70
|
+
</element>
|
71
|
+
</define>
|
35
72
|
<define name="index">
|
36
73
|
<element name="index">
|
37
74
|
<optional>
|
@@ -245,6 +282,9 @@
|
|
245
282
|
<ref name="MultilingualRenderingType"/>
|
246
283
|
</attribute>
|
247
284
|
</optional>
|
285
|
+
<optional>
|
286
|
+
<ref name="tname"/>
|
287
|
+
</optional>
|
248
288
|
<oneOrMore>
|
249
289
|
<ref name="ul_li"/>
|
250
290
|
</oneOrMore>
|
@@ -287,6 +327,9 @@
|
|
287
327
|
</choice>
|
288
328
|
</attribute>
|
289
329
|
</optional>
|
330
|
+
<optional>
|
331
|
+
<ref name="tname"/>
|
332
|
+
</optional>
|
290
333
|
<oneOrMore>
|
291
334
|
<ref name="li"/>
|
292
335
|
</oneOrMore>
|
@@ -323,6 +366,9 @@
|
|
323
366
|
<ref name="MultilingualRenderingType"/>
|
324
367
|
</attribute>
|
325
368
|
</optional>
|
369
|
+
<optional>
|
370
|
+
<ref name="tname"/>
|
371
|
+
</optional>
|
326
372
|
<oneOrMore>
|
327
373
|
<ref name="dt"/>
|
328
374
|
<ref name="dd"/>
|
@@ -851,6 +897,16 @@
|
|
851
897
|
<ref name="MultilingualRenderingType"/>
|
852
898
|
</attribute>
|
853
899
|
</optional>
|
900
|
+
<optional>
|
901
|
+
<attribute name="coverpage">
|
902
|
+
<data type="boolean"/>
|
903
|
+
</attribute>
|
904
|
+
</optional>
|
905
|
+
<optional>
|
906
|
+
<attribute name="notag">
|
907
|
+
<data type="boolean"/>
|
908
|
+
</attribute>
|
909
|
+
</optional>
|
854
910
|
<oneOrMore>
|
855
911
|
<choice>
|
856
912
|
<ref name="paragraph"/>
|
@@ -1178,6 +1234,7 @@
|
|
1178
1234
|
<ref name="concept"/>
|
1179
1235
|
<ref name="add"/>
|
1180
1236
|
<ref name="del"/>
|
1237
|
+
<ref name="span"/>
|
1181
1238
|
</choice>
|
1182
1239
|
</define>
|
1183
1240
|
<define name="add">
|
@@ -1204,6 +1261,14 @@
|
|
1204
1261
|
</choice>
|
1205
1262
|
</element>
|
1206
1263
|
</define>
|
1264
|
+
<define name="span">
|
1265
|
+
<element name="span">
|
1266
|
+
<attribute name="class"/>
|
1267
|
+
<oneOrMore>
|
1268
|
+
<ref name="TextElement"/>
|
1269
|
+
</oneOrMore>
|
1270
|
+
</element>
|
1271
|
+
</define>
|
1207
1272
|
<define name="concept">
|
1208
1273
|
<element name="concept">
|
1209
1274
|
<optional>
|
data/metanorma-ietf.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
|
38
38
|
spec.add_dependency "mathml2asciimath"
|
39
39
|
spec.add_dependency "metanorma-ietf-data"
|
40
|
-
spec.add_dependency "metanorma-standoc", "~> 2.
|
40
|
+
spec.add_dependency "metanorma-standoc", "~> 2.1.0"
|
41
41
|
|
42
42
|
spec.add_development_dependency "debug"
|
43
43
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
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.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mathml2asciimath
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
47
|
+
version: 2.1.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
54
|
+
version: 2.1.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: debug
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -235,9 +235,6 @@ files:
|
|
235
235
|
- LICENSE
|
236
236
|
- README.adoc
|
237
237
|
- Rakefile
|
238
|
-
- docs/installation.md
|
239
|
-
- docs/navigation.md
|
240
|
-
- docs/overview.md
|
241
238
|
- lib/isodoc/ietf/SVG-1.2-RFC.rng
|
242
239
|
- lib/isodoc/ietf/blocks.rb
|
243
240
|
- lib/isodoc/ietf/cleanup.rb
|
@@ -296,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
293
|
- !ruby/object:Gem::Version
|
297
294
|
version: '0'
|
298
295
|
requirements: []
|
299
|
-
rubygems_version: 3.3.
|
296
|
+
rubygems_version: 3.3.7
|
300
297
|
signing_key:
|
301
298
|
specification_version: 4
|
302
299
|
summary: metanorma-ietf lets you write IETF documents, such as Internet-Drafts and
|
data/docs/installation.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Installation
|
3
|
-
---
|
4
|
-
|
5
|
-
Add this line to your application’s Gemfile:
|
6
|
-
|
7
|
-
```
|
8
|
-
gem "metanorma-ietf"
|
9
|
-
```
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
```
|
14
|
-
$ bundle
|
15
|
-
```
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
```
|
20
|
-
$ gem install metanorma-cli
|
21
|
-
```
|
data/docs/navigation.md
DELETED