metanorma-generic 3.4.2 → 3.4.3
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/generic/metadata.rb +1 -1
- data/lib/metanorma/generic/basicdoc.rng +1 -1
- data/lib/metanorma/generic/cleanup.rb +0 -37
- data/lib/metanorma/generic/converter.rb +0 -1
- data/lib/metanorma/generic/{mathml3-content.rng → mathml4-content.rng} +104 -80
- data/lib/metanorma/generic/mathml4-core.rng +1041 -0
- data/lib/metanorma/generic/{mathml3-presentation.rng → mathml4-presentation.rng} +184 -1060
- data/lib/metanorma/generic/{mathml3-strict-content.rng → mathml4-strict-content.rng} +92 -8
- data/lib/metanorma/generic/mathml4.rng +30 -0
- data/lib/metanorma/generic/metanorma-mathml.rng +22 -8
- data/lib/metanorma/generic/validate.rb +16 -2
- data/lib/metanorma/generic/version.rb +1 -1
- data/metanorma-generic.gemspec +1 -1
- metadata +8 -10
- data/.hound.yml +0 -5
- data/lib/metanorma/generic/bibdata_config.rb +0 -26
- data/lib/metanorma/generic/mathml3-common.rng +0 -257
- data/lib/metanorma/generic/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: cc693024c1d1f0ec1b1123bb5e8ff37e06a832f06e96b5b50d9cfbc2653ff008
|
|
4
|
+
data.tar.gz: e32f6f58c01a1d7ac7c026e5aca062275434a6c18fbc0090cfcb053ea400bd3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b052ae43f0047fb153677ef53dc7613e4a1b265ed7015124426c424b77a4e3d2b9c86858b9864bcdcd9e4b4e36d22ffe15cd34d4f3684d3665b5b0f0f1aafad
|
|
7
|
+
data.tar.gz: 9bd6aeff29714b725dc15e4335bd390afdab8298d964d692d28e98c627b7641f5fb14757df3415b18c77c0a1ace0a05880dddca0b884a15c19d25d5c671b8c66
|
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
|
|
@@ -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"/>
|
|
@@ -15,47 +15,10 @@ module Metanorma
|
|
|
15
15
|
Metanorma::Generic::Configuration::CONFIG_ATTRS.each do |a|
|
|
16
16
|
conv.meta.set(a, configuration.send(a))
|
|
17
17
|
end
|
|
18
|
-
conv.meta.set(:bibdata, bibdata_hash(xmldoc))
|
|
19
18
|
@isodoc = conv
|
|
20
19
|
@isodoc
|
|
21
20
|
end
|
|
22
21
|
|
|
23
|
-
def bibdata_hash(xmldoc)
|
|
24
|
-
b = xmldoc.at("//bibdata") || xmldoc.at("//xmlns:bibdata") or return nil
|
|
25
|
-
stripped = Nokogiri::XML(b.to_xml)
|
|
26
|
-
stripped.remove_namespaces!
|
|
27
|
-
# Drop @boilerplate="true" docidentifiers before handing the
|
|
28
|
-
# bibdata to Relaton::Cli.parse_xml: their content is an
|
|
29
|
-
# unresolved Liquid template, and recent relaton-iho /
|
|
30
|
-
# relaton-cc / etc. eagerly call pubid in their docidentifier
|
|
31
|
-
# content= setter, which crashes on raw Liquid syntax. The
|
|
32
|
-
# template variables for substitution come from other bibdata
|
|
33
|
-
# fields (seriesabbr, docnumeric, …), not from the
|
|
34
|
-
# docidentifier itself, so dropping it here does not affect
|
|
35
|
-
# what we feed back into isodoc.meta. Substitution still runs
|
|
36
|
-
# on the original xmldoc via standoc's
|
|
37
|
-
# docidentifier_boilerplate_isodoc; afterwards
|
|
38
|
-
# refresh_isodoc_bibdata re-calls bibdata_hash to seed
|
|
39
|
-
# isodoc.meta with the resolved docidentifier.
|
|
40
|
-
# See https://github.com/metanorma/metanorma/issues/558.
|
|
41
|
-
stripped.xpath("//docidentifier[@boilerplate = 'true']").each(&:remove)
|
|
42
|
-
bib = BibdataConfig.from_xml(
|
|
43
|
-
"<metanorma>#{stripped.root.to_xml}</metanorma>",
|
|
44
|
-
).bibdata or return nil
|
|
45
|
-
YAML.safe_load(bib.to_yaml, permitted_classes: [Date, Symbol],
|
|
46
|
-
symbolize_names: true)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Override standoc's hook: in addition to re-running
|
|
50
|
-
# isodoc_bibdata_parse, refresh conv.meta[:bibdata] with the
|
|
51
|
-
# bibdata_hash now that docidentifiers have been substituted, so
|
|
52
|
-
# downstream consumers (boilerplate Liquid expansion, coverpage
|
|
53
|
-
# interpolation, etc.) see the resolved values.
|
|
54
|
-
def refresh_isodoc_bibdata(xmldoc, conv)
|
|
55
|
-
super
|
|
56
|
-
conv.meta.set(:bibdata, bibdata_hash(xmldoc))
|
|
57
|
-
end
|
|
58
|
-
|
|
59
22
|
def boilerplate_file(xmldoc)
|
|
60
23
|
f = configuration.boilerplate
|
|
61
24
|
f.nil? and return super
|
|
@@ -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/>
|