metanorma-ietf 3.7.7 → 3.7.8
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/.rubocop.yml +9 -0
- data/lib/isodoc/ietf/cleanup.rb +16 -7
- data/lib/isodoc/ietf/cleanup_blocks.rb +11 -2
- data/lib/isodoc/ietf/inline.rb +8 -4
- data/lib/isodoc/ietf/metadata.rb +7 -1
- data/lib/metanorma/ietf/basicdoc.rng +1 -1
- data/lib/metanorma/ietf/{mathml3-content.rng → mathml4-content.rng} +104 -80
- data/lib/metanorma/ietf/mathml4-core.rng +1041 -0
- data/lib/metanorma/ietf/{mathml3-presentation.rng → mathml4-presentation.rng} +184 -1060
- data/lib/metanorma/ietf/{mathml3-strict-content.rng → mathml4-strict-content.rng} +92 -8
- data/lib/metanorma/ietf/mathml4.rng +30 -0
- data/lib/metanorma/ietf/metanorma-mathml.rng +22 -8
- data/lib/metanorma/ietf/version.rb +1 -1
- data/lib/relaton/render/config.yml +3 -3
- data/lib/relaton/render/fields.rb +3 -1
- data/lib/relaton/render/parse.rb +34 -10
- metadata +6 -7
- data/.hound.yml +0 -5
- data/lib/metanorma/ietf/mathml3-common.rng +0 -257
- data/lib/metanorma/ietf/mathml3.rng +0 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e8481e986bb9e8f6f6544aa626251e7d4af18be4650a654c6fa6e1f9f4c093e
|
|
4
|
+
data.tar.gz: 26b7391ce2715daf4ce3f7c10387ce9620b5485229b646ca8c1817bf0206797f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7edb00b1b05b750cdba48d04dc71f7725f9b6086db0b8c76c6f8b793e72a8c914a6949bf5613da391d9149b175dde49762f639498a75e0c01b20294abcc091d2
|
|
7
|
+
data.tar.gz: ca1b556936be2cb95a8ab1bad6af2b2d1db870869cb76752bd1f14f5f1a7fd95b7fbca17adb596d011ee48245c6135474b8df05b4f5530261a0b6e6db7d37371
|
data/.rubocop.yml
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
# See https://github.com/metanorma/cimas
|
|
3
3
|
inherit_from:
|
|
4
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
5
|
+
# .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
|
|
6
|
+
# if listed before oss-guides, the shared config's stricter Metrics/
|
|
7
|
+
# (MethodLength, BlockLength, etc.) rules override the todo's per-file
|
|
8
|
+
# grandfathering, and the todo becomes inert on those cops. Empirically
|
|
9
|
+
# verified on suma 2026-07-06: with todo listed first, 34 Metrics/* offenses
|
|
10
|
+
# remained; moved last, cleared. Every gem in the metanorma-org fleet
|
|
11
|
+
# already ships a `.rubocop_todo.yml` on its live tree (audited 2026-07-06,
|
|
12
|
+
# 54/54 have it), so this reference is safe to emit unconditionally.
|
|
13
|
+
- .rubocop_todo.yml
|
|
5
14
|
|
|
6
15
|
# Rubocop plugins enabled centrally so every metanorma-org gem picks them up
|
|
7
16
|
# on cimas sync — best practice belongs at the shared-template layer, not
|
data/lib/isodoc/ietf/cleanup.rb
CHANGED
|
@@ -79,7 +79,8 @@ module IsoDoc
|
|
|
79
79
|
xmldoc.xpath("//refcontent").each do |a|
|
|
80
80
|
val = a.text.strip
|
|
81
81
|
if val.empty? then a.remove
|
|
82
|
-
else a.
|
|
82
|
+
else a.content = val # not children=: a literal "<" in the text
|
|
83
|
+
# would be reparsed as markup and fabricate an element (#267)
|
|
83
84
|
end
|
|
84
85
|
end
|
|
85
86
|
end
|
|
@@ -98,18 +99,26 @@ module IsoDoc
|
|
|
98
99
|
end.join
|
|
99
100
|
end
|
|
100
101
|
|
|
102
|
+
# Flatten titles to the plain text RFC XML v3 allows, without a
|
|
103
|
+
# string -> XML round-trip: replacing an empty eref with its raw
|
|
104
|
+
# target string, then reparsing the title text as markup, fabricated
|
|
105
|
+
# an element out of a URL adjacent to a literal "<" in a formattedref
|
|
106
|
+
# ("<http:>", a QName violation fatal to xml2rfc, #267). Text nodes
|
|
107
|
+
# and content= keep the same flattening semantics with escaping.
|
|
101
108
|
def front_cleanup(xmldoc)
|
|
102
|
-
xmldoc.xpath("//title").each
|
|
103
|
-
s.xpath(".//eref[normalize-space(.)='']").each do |e|
|
|
104
|
-
e.replace(e["target"])
|
|
105
|
-
end
|
|
106
|
-
s.children = s.text
|
|
107
|
-
end
|
|
109
|
+
xmldoc.xpath("//title").each { |s| title_flatten(s, xmldoc) }
|
|
108
110
|
xmldoc.xpath("//reference/front[not(author)]").each do |f|
|
|
109
111
|
insert = f.at("./seriesInfo[last()]") || f.at("./title")
|
|
110
112
|
insert.next = "<author surname='Unknown'/>"
|
|
111
113
|
end
|
|
112
114
|
end
|
|
115
|
+
|
|
116
|
+
def title_flatten(title, xmldoc)
|
|
117
|
+
title.xpath(".//eref[normalize-space(.)='']").each do |e|
|
|
118
|
+
e.replace(xmldoc.create_text_node(e["target"]))
|
|
119
|
+
end
|
|
120
|
+
title.content = title.text
|
|
121
|
+
end
|
|
113
122
|
end
|
|
114
123
|
end
|
|
115
124
|
end
|
|
@@ -117,14 +117,23 @@ module IsoDoc
|
|
|
117
117
|
|
|
118
118
|
def crossref_remove_markup_elem(node)
|
|
119
119
|
case node.name
|
|
120
|
-
when "eref"
|
|
121
|
-
node.replace(node.children.empty? ? node["target"] : node.children)
|
|
120
|
+
when "eref" then crossref_flatten_eref(node)
|
|
122
121
|
when "xref"
|
|
123
122
|
node.children.empty? ? sourcecode_xref(node) : node.replace(node.children)
|
|
124
123
|
# when "relref" then n.replace(n.children.empty? ? n["target"] : n.children)
|
|
125
124
|
end
|
|
126
125
|
end
|
|
127
126
|
|
|
127
|
+
# empty eref: insert the target as a text node, not a raw string
|
|
128
|
+
# that Nokogiri would reparse as markup (#267)
|
|
129
|
+
def crossref_flatten_eref(node)
|
|
130
|
+
if node.children.empty?
|
|
131
|
+
node.replace(node.document.create_text_node(node["target"]))
|
|
132
|
+
else
|
|
133
|
+
node.replace(node.children)
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
128
137
|
def sourcecode_remove_markup_elem(node)
|
|
129
138
|
case node.name
|
|
130
139
|
when "br" then node.replace("\n")
|
data/lib/isodoc/ietf/inline.rb
CHANGED
|
@@ -142,18 +142,22 @@ module IsoDoc
|
|
|
142
142
|
end
|
|
143
143
|
end
|
|
144
144
|
|
|
145
|
+
# Empty localities are omitted, not emitted as section=""
|
|
146
|
+
# relative="" junk attributes (#269): attr_code drops nil, not ""
|
|
145
147
|
def eref_relative(node)
|
|
146
|
-
node["relative"] ||
|
|
147
|
-
node.at(ns(".//locality[@type = 'anchor']/referenceFrom"))&.text
|
|
148
|
+
ret = node["relative"] ||
|
|
149
|
+
node.at(ns(".//locality[@type = 'anchor']/referenceFrom"))&.text
|
|
150
|
+
ret.nil? || ret.empty? ? nil : ret
|
|
148
151
|
end
|
|
149
152
|
|
|
150
153
|
def eref_section(node)
|
|
151
154
|
ret = @isodoc.eref_localities(
|
|
152
155
|
node.xpath(ns("./locality | ./localityStack")), nil, node
|
|
153
|
-
) or return
|
|
154
|
-
ret.gsub(%r{</?span[^>]*>}, "").sub(/^,/, "")
|
|
156
|
+
) or return nil
|
|
157
|
+
ret = ret.gsub(%r{</?span[^>]*>}, "").sub(/^,/, "")
|
|
155
158
|
.sub(/^\s*(Sections?|Clauses?)/, "").strip.sub(/,$/, "")
|
|
156
159
|
.gsub(/\s+/, " ")
|
|
160
|
+
ret.empty? ? nil : ret
|
|
157
161
|
end
|
|
158
162
|
|
|
159
163
|
def semx_origin_parse(node, out)
|
data/lib/isodoc/ietf/metadata.rb
CHANGED
|
@@ -47,9 +47,15 @@ module IsoDoc
|
|
|
47
47
|
set(:wg, workgroups)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
# Standoc emits <doctype>rfc</doctype>, which the base class
|
|
51
|
+
# capitalises to "Rfc"; the front/section renderers compare against
|
|
52
|
+
# the exact "RFC", so the document's own RFC seriesInfo (and with it
|
|
53
|
+
# the "Request for Comments" masthead line) was dropped (#268).
|
|
54
|
+
# Normalise casing here so every consumer sees "RFC".
|
|
50
55
|
def doctype(isoxml, _out)
|
|
51
56
|
super
|
|
52
|
-
|
|
57
|
+
d = get[:doctype]
|
|
58
|
+
d.nil? || d.casecmp?("rfc") and set(:doctype, "RFC")
|
|
53
59
|
end
|
|
54
60
|
|
|
55
61
|
def initialize(lang, script, locale, i18n, fonts_options = {})
|
|
@@ -1931,7 +1931,7 @@ or as the string "auto"</a:documentation>
|
|
|
1931
1931
|
</element>
|
|
1932
1932
|
</define>
|
|
1933
1933
|
<define name="mathml">
|
|
1934
|
-
<a:documentation>Encoding of MathML: the official W3C MathML
|
|
1934
|
+
<a:documentation>Encoding of MathML: the official W3C MathML 4 grammar (namespace
|
|
1935
1935
|
http://www.w3.org/1998/Math/MathML), via the metanorma wrapper in
|
|
1936
1936
|
grammars/mathml/. See grammars/mathml/README.adoc and basicdoc-models#35.</a:documentation>
|
|
1937
1937
|
<externalRef href="metanorma-mathml.rng"/>
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<include href="
|
|
2
|
+
<!--
|
|
3
|
+
MathML 4 (Content)
|
|
4
|
+
##################
|
|
5
|
+
-->
|
|
6
|
+
<!--
|
|
7
|
+
Copyright 1998-2026 W3C (MIT, ERCIM, Keio, Beihang)
|
|
8
|
+
|
|
9
|
+
Use and distribution of this code are permitted under the terms
|
|
10
|
+
W3C Software Notice and License
|
|
11
|
+
http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
|
|
12
|
+
-->
|
|
13
|
+
<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
14
|
+
<include href="mathml4-strict-content.rng">
|
|
15
15
|
<define name="cn.content">
|
|
16
16
|
<zeroOrMore>
|
|
17
17
|
<choice>
|
|
18
18
|
<text/>
|
|
19
|
-
<ref name="mglyph"/>
|
|
20
19
|
<ref name="sep"/>
|
|
21
20
|
<ref name="PresentationExpression"/>
|
|
22
21
|
</choice>
|
|
@@ -46,7 +45,6 @@
|
|
|
46
45
|
<zeroOrMore>
|
|
47
46
|
<choice>
|
|
48
47
|
<text/>
|
|
49
|
-
<ref name="mglyph"/>
|
|
50
48
|
<ref name="PresentationExpression"/>
|
|
51
49
|
</choice>
|
|
52
50
|
</zeroOrMore>
|
|
@@ -65,11 +63,22 @@
|
|
|
65
63
|
<zeroOrMore>
|
|
66
64
|
<choice>
|
|
67
65
|
<text/>
|
|
68
|
-
<ref name="mglyph"/>
|
|
69
66
|
<ref name="PresentationExpression"/>
|
|
70
67
|
</choice>
|
|
71
68
|
</zeroOrMore>
|
|
72
69
|
</define>
|
|
70
|
+
<define name="annotation-xml.attributes" combine="choice">
|
|
71
|
+
<ref name="CommonAtt"/>
|
|
72
|
+
<optional>
|
|
73
|
+
<ref name="cd"/>
|
|
74
|
+
</optional>
|
|
75
|
+
<optional>
|
|
76
|
+
<ref name="name"/>
|
|
77
|
+
</optional>
|
|
78
|
+
<optional>
|
|
79
|
+
<ref name="encoding"/>
|
|
80
|
+
</optional>
|
|
81
|
+
</define>
|
|
73
82
|
<define name="bvar">
|
|
74
83
|
<element name="bvar">
|
|
75
84
|
<ref name="CommonAtt"/>
|
|
@@ -113,6 +122,63 @@
|
|
|
113
122
|
<ref name="apply.content"/>
|
|
114
123
|
</define>
|
|
115
124
|
</include>
|
|
125
|
+
<define name="NonMathMLAtt" combine="choice">
|
|
126
|
+
<attribute>
|
|
127
|
+
<anyName>
|
|
128
|
+
<except>
|
|
129
|
+
<nsName ns=""/>
|
|
130
|
+
<nsName/>
|
|
131
|
+
</except>
|
|
132
|
+
</anyName>
|
|
133
|
+
<data type="string"/>
|
|
134
|
+
</attribute>
|
|
135
|
+
</define>
|
|
136
|
+
<!--
|
|
137
|
+
METANORMA MODIFICATION (basicdoc-models#39): upstream re-adds
|
|
138
|
+
`attribute alttext` to math.attributes here, but mathml4-core.rnc already
|
|
139
|
+
defines it on math; RELAX NG's duplicate-attribute restriction rejects the
|
|
140
|
+
composed grammar (jing: 'duplicate attribute "alttext"').
|
|
141
|
+
Upstream text was:
|
|
142
|
+
math.attributes &=
|
|
143
|
+
attribute alttext {text}?
|
|
144
|
+
-->
|
|
145
|
+
<!--
|
|
146
|
+
METANORMA MODIFICATION (basicdoc-models#39): upstream re-adds the
|
|
147
|
+
`data-other` placeholder to MathMLDataAttributes here; dropped for the
|
|
148
|
+
same reason as the core placeholder (see mathml4-core.rnc modification).
|
|
149
|
+
Upstream text was:
|
|
150
|
+
MathMLDataAttributes &=
|
|
151
|
+
attribute data-other {text}?
|
|
152
|
+
-->
|
|
153
|
+
<define name="CommonAtt" combine="interleave">
|
|
154
|
+
<zeroOrMore>
|
|
155
|
+
<ref name="NonMathMLAtt"/>
|
|
156
|
+
</zeroOrMore>
|
|
157
|
+
<ref name="MathMLDataAttributes"/>
|
|
158
|
+
<optional>
|
|
159
|
+
<attribute name="class">
|
|
160
|
+
<data type="NCName"/>
|
|
161
|
+
</attribute>
|
|
162
|
+
</optional>
|
|
163
|
+
<optional>
|
|
164
|
+
<attribute name="style">
|
|
165
|
+
<data type="string"/>
|
|
166
|
+
</attribute>
|
|
167
|
+
</optional>
|
|
168
|
+
<optional>
|
|
169
|
+
<attribute name="href">
|
|
170
|
+
<data type="anyURI"/>
|
|
171
|
+
</attribute>
|
|
172
|
+
</optional>
|
|
173
|
+
<optional>
|
|
174
|
+
<attribute name="intent"/>
|
|
175
|
+
</optional>
|
|
176
|
+
<optional>
|
|
177
|
+
<attribute name="arg">
|
|
178
|
+
<data type="NCName"/>
|
|
179
|
+
</attribute>
|
|
180
|
+
</optional>
|
|
181
|
+
</define>
|
|
116
182
|
<define name="base">
|
|
117
183
|
<attribute name="base"/>
|
|
118
184
|
</define>
|
|
@@ -124,6 +190,18 @@
|
|
|
124
190
|
<define name="PresentationExpression" combine="choice">
|
|
125
191
|
<notAllowed/>
|
|
126
192
|
</define>
|
|
193
|
+
<define name="DefEncAtt">
|
|
194
|
+
<optional>
|
|
195
|
+
<attribute name="encoding">
|
|
196
|
+
<data type="string"/>
|
|
197
|
+
</attribute>
|
|
198
|
+
</optional>
|
|
199
|
+
<optional>
|
|
200
|
+
<attribute name="definitionURL">
|
|
201
|
+
<data type="anyURI"/>
|
|
202
|
+
</attribute>
|
|
203
|
+
</optional>
|
|
204
|
+
</define>
|
|
127
205
|
<define name="DomainQ">
|
|
128
206
|
<zeroOrMore>
|
|
129
207
|
<choice>
|
|
@@ -228,60 +306,6 @@
|
|
|
228
306
|
<ref name="ContExp"/>
|
|
229
307
|
</element>
|
|
230
308
|
</define>
|
|
231
|
-
<define name="DeprecatedContExp">
|
|
232
|
-
<choice>
|
|
233
|
-
<ref name="reln"/>
|
|
234
|
-
<ref name="fn"/>
|
|
235
|
-
<ref name="declare"/>
|
|
236
|
-
</choice>
|
|
237
|
-
</define>
|
|
238
|
-
<define name="ContExp" combine="choice">
|
|
239
|
-
<ref name="DeprecatedContExp"/>
|
|
240
|
-
</define>
|
|
241
|
-
<define name="reln">
|
|
242
|
-
<element name="reln">
|
|
243
|
-
<zeroOrMore>
|
|
244
|
-
<ref name="ContExp"/>
|
|
245
|
-
</zeroOrMore>
|
|
246
|
-
</element>
|
|
247
|
-
</define>
|
|
248
|
-
<define name="fn">
|
|
249
|
-
<element name="fn">
|
|
250
|
-
<ref name="ContExp"/>
|
|
251
|
-
</element>
|
|
252
|
-
</define>
|
|
253
|
-
<define name="declare">
|
|
254
|
-
<element name="declare">
|
|
255
|
-
<optional>
|
|
256
|
-
<attribute name="type">
|
|
257
|
-
<data type="string"/>
|
|
258
|
-
</attribute>
|
|
259
|
-
</optional>
|
|
260
|
-
<optional>
|
|
261
|
-
<attribute name="scope">
|
|
262
|
-
<data type="string"/>
|
|
263
|
-
</attribute>
|
|
264
|
-
</optional>
|
|
265
|
-
<optional>
|
|
266
|
-
<attribute name="nargs">
|
|
267
|
-
<data type="nonNegativeInteger"/>
|
|
268
|
-
</attribute>
|
|
269
|
-
</optional>
|
|
270
|
-
<optional>
|
|
271
|
-
<attribute name="occurrence">
|
|
272
|
-
<choice>
|
|
273
|
-
<value>prefix</value>
|
|
274
|
-
<value>infix</value>
|
|
275
|
-
<value>function-model</value>
|
|
276
|
-
</choice>
|
|
277
|
-
</attribute>
|
|
278
|
-
</optional>
|
|
279
|
-
<ref name="DefEncAtt"/>
|
|
280
|
-
<oneOrMore>
|
|
281
|
-
<ref name="ContExp"/>
|
|
282
|
-
</oneOrMore>
|
|
283
|
-
</element>
|
|
284
|
-
</define>
|
|
285
309
|
<define name="interval.class">
|
|
286
310
|
<ref name="interval"/>
|
|
287
311
|
</define>
|
|
@@ -1253,10 +1277,10 @@
|
|
|
1253
1277
|
<define name="nary-stats.class">
|
|
1254
1278
|
<choice>
|
|
1255
1279
|
<ref name="mean"/>
|
|
1256
|
-
<ref name="sdev"/>
|
|
1257
|
-
<ref name="variance"/>
|
|
1258
1280
|
<ref name="median"/>
|
|
1259
1281
|
<ref name="mode"/>
|
|
1282
|
+
<ref name="sdev"/>
|
|
1283
|
+
<ref name="variance"/>
|
|
1260
1284
|
</choice>
|
|
1261
1285
|
</define>
|
|
1262
1286
|
<define name="ContExp" combine="choice">
|
|
@@ -1269,29 +1293,29 @@
|
|
|
1269
1293
|
<empty/>
|
|
1270
1294
|
</element>
|
|
1271
1295
|
</define>
|
|
1272
|
-
<define name="
|
|
1273
|
-
<element name="
|
|
1296
|
+
<define name="median">
|
|
1297
|
+
<element name="median">
|
|
1274
1298
|
<ref name="CommonAtt"/>
|
|
1275
1299
|
<ref name="DefEncAtt"/>
|
|
1276
1300
|
<empty/>
|
|
1277
1301
|
</element>
|
|
1278
1302
|
</define>
|
|
1279
|
-
<define name="
|
|
1280
|
-
<element name="
|
|
1303
|
+
<define name="mode">
|
|
1304
|
+
<element name="mode">
|
|
1281
1305
|
<ref name="CommonAtt"/>
|
|
1282
1306
|
<ref name="DefEncAtt"/>
|
|
1283
1307
|
<empty/>
|
|
1284
1308
|
</element>
|
|
1285
1309
|
</define>
|
|
1286
|
-
<define name="
|
|
1287
|
-
<element name="
|
|
1310
|
+
<define name="sdev">
|
|
1311
|
+
<element name="sdev">
|
|
1288
1312
|
<ref name="CommonAtt"/>
|
|
1289
1313
|
<ref name="DefEncAtt"/>
|
|
1290
1314
|
<empty/>
|
|
1291
1315
|
</element>
|
|
1292
1316
|
</define>
|
|
1293
|
-
<define name="
|
|
1294
|
-
<element name="
|
|
1317
|
+
<define name="variance">
|
|
1318
|
+
<element name="variance">
|
|
1295
1319
|
<ref name="CommonAtt"/>
|
|
1296
1320
|
<ref name="DefEncAtt"/>
|
|
1297
1321
|
<empty/>
|