metanorma-ietf 3.1.5 → 3.1.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/inline.rb +9 -1
- data/lib/isodoc/ietf/terms.rb +32 -7
- data/lib/metanorma/ietf/ietf.rng +3 -8
- data/lib/metanorma/ietf/isodoc.rng +34 -7
- data/lib/metanorma/ietf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e369ff9743d4d7458c716e2d5657b3211afd6e00f2d2edff2fabc296fb9a928
|
4
|
+
data.tar.gz: 7ff3c2920d93555731eb5a532cc2a179e44e045b259cd088e27fe10596240ef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fde6762789876d636a84673ae6a86e9742a6b9b7165ef50eaf3dc5ef2f57f6c4928de9a6a9ffae382eef3956596d23e18f026adde2ce4d8bac6d0292cf3c867
|
7
|
+
data.tar.gz: 388e7f69a84adad887fe3dac523f52758f9ef0fd8456c25071c993508915ef5a131d0773e8b1ffbd921b2e509f505837f0a1a8ed907f47b78420b50b39887ae2
|
data/lib/isodoc/ietf/inline.rb
CHANGED
@@ -93,7 +93,7 @@ module IsoDoc
|
|
93
93
|
|
94
94
|
def image_title_parse(out, caption)
|
95
95
|
unless caption.nil?
|
96
|
-
out.t
|
96
|
+
out.t align: "center", keepWithPrevious: "true" do |p|
|
97
97
|
p << caption.to_s
|
98
98
|
end
|
99
99
|
end
|
@@ -141,6 +141,14 @@ module IsoDoc
|
|
141
141
|
&.sub(/,$/, "") || ""
|
142
142
|
end
|
143
143
|
|
144
|
+
def origin_parse(node, out)
|
145
|
+
if t = node.at(ns("./termref"))
|
146
|
+
termrefelem_parse(t, out)
|
147
|
+
else
|
148
|
+
eref_parse(node, out)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
144
152
|
def index_parse(node, out)
|
145
153
|
out.iref nil, **attr_code(item: node.at(ns("./primary")).text,
|
146
154
|
primary: node["primary"],
|
data/lib/isodoc/ietf/terms.rb
CHANGED
@@ -37,13 +37,6 @@ module IsoDoc
|
|
37
37
|
note_parse(node, out)
|
38
38
|
end
|
39
39
|
|
40
|
-
def termref_parse(node, out)
|
41
|
-
out.t do |p|
|
42
|
-
p << "SOURCE: "
|
43
|
-
node.children.each { |n| parse(n, p) }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
40
|
def termdef_parse(node, out)
|
48
41
|
set_termdomain("")
|
49
42
|
node.xpath(ns("./definition")).size > 1 and
|
@@ -65,6 +58,38 @@ module IsoDoc
|
|
65
58
|
parse(r, out)
|
66
59
|
out << "]"
|
67
60
|
end
|
61
|
+
|
62
|
+
def termsource_status(status)
|
63
|
+
case status
|
64
|
+
when "modified" then @i18n.modified
|
65
|
+
when "adapted" then @i18n.adapted
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def termsource_add_modification_text(mod)
|
70
|
+
mod or return
|
71
|
+
mod.text.strip.empty? or mod.previous = " – "
|
72
|
+
mod.elements.size == 1 and
|
73
|
+
mod.elements[0].replace(mod.elements[0].children)
|
74
|
+
mod.replace(mod.children)
|
75
|
+
end
|
76
|
+
|
77
|
+
def preprocess_termref(elem)
|
78
|
+
origin = elem.at(ns("./origin"))
|
79
|
+
s = termsource_status(elem["status"]) and origin.next = l10n(", #{s}")
|
80
|
+
termsource_add_modification_text(elem.at(ns("./modification")))
|
81
|
+
while elem&.next_element&.name == "termsource"
|
82
|
+
elem << "; #{to_xml(elem.next_element.remove.children)}"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def termref_parse(elem, out)
|
87
|
+
preprocess_termref(elem)
|
88
|
+
elem.children = l10n("[#{@i18n.source}: #{to_xml(elem.children).strip}]")
|
89
|
+
out.t do |p|
|
90
|
+
elem.children.each { |n| parse(n, p) }
|
91
|
+
end
|
92
|
+
end
|
68
93
|
end
|
69
94
|
end
|
70
95
|
end
|
data/lib/metanorma/ietf/ietf.rng
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns=
|
2
|
+
<grammar ns='https://www.metanorma.org/ns/ietf' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<!--
|
4
|
+
VERSION v1.2.1
|
4
5
|
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
5
6
|
we cannot have a new default namespace: we will end up with a grammar with two different
|
6
7
|
namespaces, one for isostandard and one for ietf additions. And we do not want that.
|
@@ -584,13 +585,7 @@
|
|
584
585
|
</define>
|
585
586
|
<define name="ietf-standard">
|
586
587
|
<element name="ietf-standard">
|
587
|
-
<
|
588
|
-
<attribute name="type">
|
589
|
-
<choice>
|
590
|
-
<value>semantic</value>
|
591
|
-
<value>presentation</value>
|
592
|
-
</choice>
|
593
|
-
</attribute>
|
588
|
+
<ref name="Root-Attributes"/>
|
594
589
|
<ref name="bibdata"/>
|
595
590
|
<zeroOrMore>
|
596
591
|
<ref name="termdocsource"/>
|
@@ -17,6 +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.2 -->
|
20
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">
|
21
22
|
<include href="reqt.rng"/>
|
22
23
|
<include href="basicdoc.rng">
|
@@ -210,6 +211,9 @@
|
|
210
211
|
<data type="boolean"/>
|
211
212
|
</attribute>
|
212
213
|
</optional>
|
214
|
+
<optional>
|
215
|
+
<attribute name="style"/>
|
216
|
+
</optional>
|
213
217
|
<ref name="CitationType"/>
|
214
218
|
<oneOrMore>
|
215
219
|
<ref name="PureTextElement"/>
|
@@ -1008,6 +1012,7 @@
|
|
1008
1012
|
<ref name="del"/>
|
1009
1013
|
<ref name="span"/>
|
1010
1014
|
<ref name="erefstack"/>
|
1015
|
+
<ref name="date_inline"/>
|
1011
1016
|
</choice>
|
1012
1017
|
</define>
|
1013
1018
|
<define name="add">
|
@@ -1049,6 +1054,23 @@
|
|
1049
1054
|
</oneOrMore>
|
1050
1055
|
</element>
|
1051
1056
|
</define>
|
1057
|
+
<define name="date_inline">
|
1058
|
+
<element name="date">
|
1059
|
+
<attribute name="value"/>
|
1060
|
+
<optional>
|
1061
|
+
<attribute name="format"/>
|
1062
|
+
</optional>
|
1063
|
+
<optional>
|
1064
|
+
<attribute name="language"/>
|
1065
|
+
</optional>
|
1066
|
+
<optional>
|
1067
|
+
<attribute name="script"/>
|
1068
|
+
</optional>
|
1069
|
+
<optional>
|
1070
|
+
<attribute name="locale"/>
|
1071
|
+
</optional>
|
1072
|
+
</element>
|
1073
|
+
</define>
|
1052
1074
|
<define name="concept">
|
1053
1075
|
<element name="concept">
|
1054
1076
|
<optional>
|
@@ -1349,15 +1371,19 @@
|
|
1349
1371
|
</choice>
|
1350
1372
|
</element>
|
1351
1373
|
</define>
|
1374
|
+
<define name="Root-Attributes">
|
1375
|
+
<attribute name="version"/>
|
1376
|
+
<attribute name="schema-version"/>
|
1377
|
+
<attribute name="type">
|
1378
|
+
<choice>
|
1379
|
+
<value>semantic</value>
|
1380
|
+
<value>presentation</value>
|
1381
|
+
</choice>
|
1382
|
+
</attribute>
|
1383
|
+
</define>
|
1352
1384
|
<define name="standard-document">
|
1353
1385
|
<element name="standard-document">
|
1354
|
-
<
|
1355
|
-
<attribute name="type">
|
1356
|
-
<choice>
|
1357
|
-
<value>semantic</value>
|
1358
|
-
<value>presentation</value>
|
1359
|
-
</choice>
|
1360
|
-
</attribute>
|
1386
|
+
<ref name="Root-Attributes"/>
|
1361
1387
|
<ref name="bibdata"/>
|
1362
1388
|
<optional>
|
1363
1389
|
<ref name="misccontainer"/>
|
@@ -2131,6 +2157,7 @@
|
|
2131
2157
|
<choice>
|
2132
2158
|
<value>identical</value>
|
2133
2159
|
<value>modified</value>
|
2160
|
+
<value>adapted</value>
|
2134
2161
|
<value>restyled</value>
|
2135
2162
|
<value>context-added</value>
|
2136
2163
|
<value>generalisation</value>
|
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.1.
|
4
|
+
version: 3.1.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: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mathml2asciimath
|