mml 2.3.0 → 2.3.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/.gitmodules +9 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +30 -21
- data/Gemfile +0 -2
- data/README.adoc +176 -47
- data/Rakefile +16 -1
- data/lib/mml/base/content/annotation.rb +30 -0
- data/lib/mml/base/content/annotation_xml.rb +31 -0
- data/lib/mml/base/content/apply.rb +27 -0
- data/lib/mml/base/content/arith.rb +243 -0
- data/lib/mml/base/content/bind.rb +27 -0
- data/lib/mml/base/content/bvar.rb +20 -0
- data/lib/mml/base/content/calculus.rb +103 -0
- data/lib/mml/base/content/cbytes.rb +24 -0
- data/lib/mml/base/content/cerror.rb +24 -0
- data/lib/mml/base/content/ci.rb +77 -0
- data/lib/mml/base/content/cn.rb +33 -0
- data/lib/mml/base/content/condition.rb +20 -0
- data/lib/mml/base/content/constants.rb +173 -0
- data/lib/mml/base/content/cs.rb +22 -0
- data/lib/mml/base/content/csymbol.rb +79 -0
- data/lib/mml/base/content/declare.rb +34 -0
- data/lib/mml/base/content/degree.rb +20 -0
- data/lib/mml/base/content/elementary_functions.rb +309 -0
- data/lib/mml/base/content/fn.rb +25 -0
- data/lib/mml/base/content/functions.rb +85 -0
- data/lib/mml/base/content/interval.rb +24 -0
- data/lib/mml/base/content/inverse.rb +25 -0
- data/lib/mml/base/content/lambda.rb +20 -0
- data/lib/mml/base/content/linear_algebra.rb +122 -0
- data/lib/mml/base/content/logic.rb +93 -0
- data/lib/mml/base/content/otherwise.rb +20 -0
- data/lib/mml/base/content/piece.rb +20 -0
- data/lib/mml/base/content/piecewise.rb +20 -0
- data/lib/mml/base/content/relations.rb +113 -0
- data/lib/mml/base/content/reln.rb +19 -0
- data/lib/mml/base/content/semantics.rb +27 -0
- data/lib/mml/base/content/sep.rb +19 -0
- data/lib/mml/base/content/sets.rb +163 -0
- data/lib/mml/base/content/share.rb +24 -0
- data/lib/mml/base/content/statistics.rb +95 -0
- data/lib/mml/base/content/vector_calculus.rb +63 -0
- data/lib/mml/base/content_loader.rb +195 -0
- data/lib/mml/base/maction.rb +1 -0
- data/lib/mml/base/math.rb +41 -0
- data/lib/mml/base/menclose.rb +1 -1
- data/lib/mml/base/mfenced.rb +2 -2
- data/lib/mml/base/mfrac.rb +2 -0
- data/lib/mml/base/mglyph.rb +2 -0
- data/lib/mml/base/mi.rb +7 -2
- data/lib/mml/base/mlabeledtr.rb +0 -4
- data/lib/mml/base/mn.rb +5 -2
- data/lib/mml/base/mo.rb +0 -2
- data/lib/mml/base/mrow.rb +0 -2
- data/lib/mml/base/ms.rb +2 -4
- data/lib/mml/base/mscarries.rb +1 -1
- data/lib/mml/base/mstyle.rb +2 -6
- data/lib/mml/base/mtable.rb +8 -0
- data/lib/mml/base/mtd.rb +6 -0
- data/lib/mml/base/mtext.rb +0 -2
- data/lib/mml/base/semantics.rb +4 -2
- data/lib/mml/base/universal_presentation_attributes.rb +42 -0
- data/lib/mml/base/v3_common.rb +16 -0
- data/lib/mml/base/v3_presentation_attributes.rb +15 -0
- data/lib/mml/base/v4_attributes.rb +4 -18
- data/lib/mml/base.rb +10 -0
- data/lib/mml/common_elements.rb +334 -0
- data/lib/mml/context_configuration.rb +29 -0
- data/lib/mml/v2/annotation.rb +9 -0
- data/lib/mml/v2/annotation_xml.rb +9 -0
- data/lib/mml/v2/apply.rb +9 -0
- data/lib/mml/v2/arith.rb +93 -0
- data/lib/mml/v2/bind.rb +9 -0
- data/lib/mml/v2/bvar.rb +9 -0
- data/lib/mml/v2/calculus.rb +33 -0
- data/lib/mml/v2/ci.rb +9 -0
- data/lib/mml/v2/cn.rb +9 -0
- data/lib/mml/v2/common_elements.rb +34 -0
- data/lib/mml/v2/condition.rb +9 -0
- data/lib/mml/v2/configuration.rb +13 -0
- data/lib/mml/v2/constants.rb +65 -0
- data/lib/mml/v2/csymbol.rb +9 -0
- data/lib/mml/v2/degree.rb +9 -0
- data/lib/mml/v2/elementary_functions.rb +121 -0
- data/lib/mml/v2/fn.rb +9 -0
- data/lib/mml/v2/functions.rb +29 -0
- data/lib/mml/v2/interval.rb +9 -0
- data/lib/mml/v2/inverse.rb +9 -0
- data/lib/mml/v2/lambda.rb +9 -0
- data/lib/mml/v2/linear_algebra.rb +41 -0
- data/lib/mml/v2/logic.rb +33 -0
- data/lib/mml/v2/maction.rb +9 -0
- data/lib/mml/v2/maligngroup.rb +9 -0
- data/lib/mml/v2/malignmark.rb +9 -0
- data/lib/mml/v2/math.rb +11 -0
- data/lib/mml/v2/menclose.rb +9 -0
- data/lib/mml/v2/merror.rb +9 -0
- data/lib/mml/v2/mfenced.rb +9 -0
- data/lib/mml/v2/mfrac.rb +9 -0
- data/lib/mml/v2/mfraction.rb +9 -0
- data/lib/mml/v2/mglyph.rb +9 -0
- data/lib/mml/v2/mi.rb +9 -0
- data/lib/mml/v2/mlabeledtr.rb +9 -0
- data/lib/mml/v2/mlongdiv.rb +9 -0
- data/lib/mml/v2/mmultiscripts.rb +9 -0
- data/lib/mml/v2/mn.rb +9 -0
- data/lib/mml/v2/mo.rb +10 -0
- data/lib/mml/v2/mover.rb +9 -0
- data/lib/mml/v2/mpadded.rb +9 -0
- data/lib/mml/v2/mphantom.rb +9 -0
- data/lib/mml/v2/mprescripts.rb +9 -0
- data/lib/mml/v2/mroot.rb +9 -0
- data/lib/mml/v2/mrow.rb +9 -0
- data/lib/mml/v2/ms.rb +9 -0
- data/lib/mml/v2/mscarries.rb +9 -0
- data/lib/mml/v2/mscarry.rb +9 -0
- data/lib/mml/v2/msgroup.rb +9 -0
- data/lib/mml/v2/msline.rb +9 -0
- data/lib/mml/v2/mspace.rb +9 -0
- data/lib/mml/v2/msqrt.rb +9 -0
- data/lib/mml/v2/msrow.rb +9 -0
- data/lib/mml/v2/mstack.rb +9 -0
- data/lib/mml/v2/mstyle.rb +10 -0
- data/lib/mml/v2/msub.rb +9 -0
- data/lib/mml/v2/msubsup.rb +9 -0
- data/lib/mml/v2/msup.rb +9 -0
- data/lib/mml/v2/mtable.rb +9 -0
- data/lib/mml/v2/mtd.rb +9 -0
- data/lib/mml/v2/mtext.rb +9 -0
- data/lib/mml/v2/mtr.rb +9 -0
- data/lib/mml/v2/munder.rb +9 -0
- data/lib/mml/v2/munderover.rb +9 -0
- data/lib/mml/v2/namespace.rb +7 -0
- data/lib/mml/v2/none.rb +9 -0
- data/lib/mml/v2/otherwise.rb +9 -0
- data/lib/mml/v2/piece.rb +9 -0
- data/lib/mml/v2/piecewise.rb +9 -0
- data/lib/mml/v2/relations.rb +41 -0
- data/lib/mml/v2/reln.rb +13 -0
- data/lib/mml/v2/semantics.rb +9 -0
- data/lib/mml/v2/sep.rb +9 -0
- data/lib/mml/v2/sets.rb +57 -0
- data/lib/mml/v2/statistics.rb +33 -0
- data/lib/mml/v2/vector_calculus.rb +21 -0
- data/lib/mml/v2.rb +311 -0
- data/lib/mml/v3/annotation.rb +10 -0
- data/lib/mml/v3/annotation_xml.rb +10 -0
- data/lib/mml/v3/apply.rb +10 -0
- data/lib/mml/v3/arith.rb +115 -0
- data/lib/mml/v3/bind.rb +10 -0
- data/lib/mml/v3/calculus.rb +40 -0
- data/lib/mml/v3/cbytes.rb +10 -0
- data/lib/mml/v3/cerror.rb +10 -0
- data/lib/mml/v3/ci.rb +10 -0
- data/lib/mml/v3/cn.rb +10 -0
- data/lib/mml/v3/common_elements.rb +34 -0
- data/lib/mml/v3/constants.rb +80 -0
- data/lib/mml/v3/constructs.rb +55 -0
- data/lib/mml/v3/cs.rb +10 -0
- data/lib/mml/v3/csymbol.rb +10 -0
- data/lib/mml/v3/deprecated_content.rb +29 -0
- data/lib/mml/v3/elementary_functions.rb +145 -0
- data/lib/mml/v3/functions.rb +35 -0
- data/lib/mml/v3/linear_algebra.rb +50 -0
- data/lib/mml/v3/logic.rb +40 -0
- data/lib/mml/v3/maction.rb +1 -1
- data/lib/mml/v3/math.rb +7 -1
- data/lib/mml/v3/mi.rb +1 -0
- data/lib/mml/v3/mn.rb +1 -0
- data/lib/mml/v3/mo.rb +1 -0
- data/lib/mml/v3/mrow.rb +1 -0
- data/lib/mml/v3/ms.rb +1 -0
- data/lib/mml/v3/mstyle.rb +1 -0
- data/lib/mml/v3/mtext.rb +1 -0
- data/lib/mml/v3/relations.rb +50 -0
- data/lib/mml/v3/sets.rb +70 -0
- data/lib/mml/v3/statistics.rb +40 -0
- data/lib/mml/v3/vector_calculus.rb +25 -0
- data/lib/mml/v3.rb +25 -0
- data/lib/mml/v4/a.rb +0 -1
- data/lib/mml/v4/annotation.rb +10 -0
- data/lib/mml/v4/annotation_xml.rb +14 -0
- data/lib/mml/v4/apply.rb +9 -0
- data/lib/mml/v4/arith.rb +93 -0
- data/lib/mml/v4/calculus.rb +25 -0
- data/lib/mml/v4/cbytes.rb +9 -0
- data/lib/mml/v4/cerror.rb +9 -0
- data/lib/mml/v4/ci.rb +9 -0
- data/lib/mml/v4/cn.rb +9 -0
- data/lib/mml/v4/common_elements.rb +33 -0
- data/lib/mml/v4/constants.rb +65 -0
- data/lib/mml/v4/constructs.rb +49 -0
- data/lib/mml/v4/cs.rb +9 -0
- data/lib/mml/v4/csymbol.rb +9 -0
- data/lib/mml/v4/deprecated_content.rb +25 -0
- data/lib/mml/v4/elementary_functions.rb +118 -0
- data/lib/mml/v4/factorof.rb +9 -0
- data/lib/mml/v4/functions.rb +30 -0
- data/lib/mml/v4/limit.rb +9 -0
- data/lib/mml/v4/linear_algebra.rb +41 -0
- data/lib/mml/v4/logic.rb +33 -0
- data/lib/mml/v4/maction.rb +1 -2
- data/lib/mml/v4/maligngroup.rb +0 -1
- data/lib/mml/v4/malignmark.rb +0 -1
- data/lib/mml/v4/math.rb +1 -1
- data/lib/mml/v4/menclose.rb +0 -1
- data/lib/mml/v4/merror.rb +0 -1
- data/lib/mml/v4/mfenced.rb +0 -1
- data/lib/mml/v4/mfrac.rb +0 -1
- data/lib/mml/v4/mfraction.rb +0 -1
- data/lib/mml/v4/mglyph.rb +0 -1
- data/lib/mml/v4/mi.rb +1 -1
- data/lib/mml/v4/mlabeledtr.rb +0 -1
- data/lib/mml/v4/mlongdiv.rb +0 -1
- data/lib/mml/v4/mmultiscripts.rb +0 -1
- data/lib/mml/v4/mn.rb +1 -1
- data/lib/mml/v4/mo.rb +1 -1
- data/lib/mml/v4/mover.rb +0 -1
- data/lib/mml/v4/mpadded.rb +0 -1
- data/lib/mml/v4/mphantom.rb +0 -1
- data/lib/mml/v4/mprescripts.rb +0 -1
- data/lib/mml/v4/mroot.rb +0 -1
- data/lib/mml/v4/mrow.rb +1 -1
- data/lib/mml/v4/ms.rb +1 -1
- data/lib/mml/v4/mscarries.rb +0 -1
- data/lib/mml/v4/mscarry.rb +0 -1
- data/lib/mml/v4/msgroup.rb +0 -1
- data/lib/mml/v4/msline.rb +0 -1
- data/lib/mml/v4/mspace.rb +0 -1
- data/lib/mml/v4/msqrt.rb +0 -1
- data/lib/mml/v4/msrow.rb +0 -1
- data/lib/mml/v4/mstack.rb +0 -1
- data/lib/mml/v4/mstyle.rb +1 -1
- data/lib/mml/v4/msub.rb +0 -1
- data/lib/mml/v4/msubsup.rb +0 -1
- data/lib/mml/v4/msup.rb +0 -1
- data/lib/mml/v4/mtable.rb +0 -1
- data/lib/mml/v4/mtd.rb +0 -1
- data/lib/mml/v4/mtext.rb +1 -1
- data/lib/mml/v4/mtr.rb +0 -1
- data/lib/mml/v4/munder.rb +0 -1
- data/lib/mml/v4/munderover.rb +0 -1
- data/lib/mml/v4/none.rb +0 -1
- data/lib/mml/v4/relations.rb +37 -0
- data/lib/mml/v4/semantics.rb +0 -1
- data/lib/mml/v4/sets.rb +57 -0
- data/lib/mml/v4/statistics.rb +33 -0
- data/lib/mml/v4/tendsto.rb +9 -0
- data/lib/mml/v4/vector_calculus.rb +21 -0
- data/lib/mml/v4.rb +421 -44
- data/lib/mml/version.rb +1 -1
- data/lib/mml/versioned_parser.rb +1 -1
- data/lib/mml.rb +3 -1
- data/reference-docs/mathml-source/pubtext/mathmlspec.dtd +150 -0
- data/reference-docs/mathml-source/pubtext/xmlspec.dtd +2649 -0
- data/reference-docs/mathml-source/readme.txt +40 -0
- data/reference-docs/mathml-source/run +296 -0
- data/reference-docs/mathml-source/style/html/html2xhtml.xsl +216 -0
- data/reference-docs/mathml-source/style/html/images.xsl +98 -0
- data/reference-docs/mathml-source/style/html/mml6.xsl +1156 -0
- data/reference-docs/mathml-source/style/html/mmldiff.xsl +566 -0
- data/reference-docs/mathml-source/style/html/mmlspec.xsl +2531 -0
- data/reference-docs/mathml-source/style/html/slices-common.xsl +312 -0
- data/reference-docs/mathml-source/style/html/slices.xsl +48 -0
- data/reference-docs/mathml-source/style/html/xmlspec.xsl +2542 -0
- data/reference-docs/mathml-source/style/pdf/mathmlspec.xsl +2510 -0
- data/reference-docs/mathml-source/xml/changes.xml +773 -0
- data/reference-docs/mathml-source/xml/character-set.xml +1011 -0
- data/reference-docs/mathml-source/xml/content-element-def.xml +6143 -0
- data/reference-docs/mathml-source/xml/content-markup.xml +8178 -0
- data/reference-docs/mathml-source/xml/contributors.xml +425 -0
- data/reference-docs/mathml-source/xml/dom-bindings.xml +20 -0
- data/reference-docs/mathml-source/xml/dom-intro.xml +114 -0
- data/reference-docs/mathml-source/xml/fundamentals.xml +1646 -0
- data/reference-docs/mathml-source/xml/glossary.xml +519 -0
- data/reference-docs/mathml-source/xml/interface.xml +1096 -0
- data/reference-docs/mathml-source/xml/introduction.xml +724 -0
- data/reference-docs/mathml-source/xml/mathml-css-sample.xml +304 -0
- data/reference-docs/mathml-source/xml/mathml-dom.xml +3813 -0
- data/reference-docs/mathml-source/xml/mathml-spec.xml +356 -0
- data/reference-docs/mathml-source/xml/mixing.xml +982 -0
- data/reference-docs/mathml-source/xml/operator-dict.xml +551 -0
- data/reference-docs/mathml-source/xml/parsing.xml +2565 -0
- data/reference-docs/mathml-source/xml/presentation-markup.xml +6834 -0
- data/reference-docs/mathml-source/xml/references.xml +323 -0
- data/reference-docs/mathml-source/xml/validation-grammar.xml +877 -0
- data/schemas/README.adoc +15 -0
- data/schemas/mathml2/CVS/Entries +4 -0
- data/schemas/mathml2/CVS/Repository +1 -0
- data/schemas/mathml2/CVS/Root +1 -0
- data/schemas/mathml2/common/CVS/Entries +4 -0
- data/schemas/mathml2/common/CVS/Repository +1 -0
- data/schemas/mathml2/common/CVS/Root +1 -0
- data/schemas/mathml2/common/common-attribs.xsd +41 -0
- data/schemas/mathml2/common/math.xsd +126 -0
- data/schemas/mathml2/common/xlink-href.xsd +20 -0
- data/schemas/mathml2/content/CVS/Entries +16 -0
- data/schemas/mathml2/content/CVS/Repository +1 -0
- data/schemas/mathml2/content/CVS/Root +1 -0
- data/schemas/mathml2/content/arith.xsd +90 -0
- data/schemas/mathml2/content/calculus.xsd +146 -0
- data/schemas/mathml2/content/common-attrib.xsd +30 -0
- data/schemas/mathml2/content/constants.xsd +83 -0
- data/schemas/mathml2/content/constructs.xsd +260 -0
- data/schemas/mathml2/content/elementary-functions.xsd +117 -0
- data/schemas/mathml2/content/functions.xsd +73 -0
- data/schemas/mathml2/content/linear-algebra.xsd +173 -0
- data/schemas/mathml2/content/logic.xsd +53 -0
- data/schemas/mathml2/content/relations.xsd +55 -0
- data/schemas/mathml2/content/semantics.xsd +85 -0
- data/schemas/mathml2/content/sets.xsd +236 -0
- data/schemas/mathml2/content/statistics.xsd +136 -0
- data/schemas/mathml2/content/tokens.xsd +120 -0
- data/schemas/mathml2/content/tokens.xsd.~1.3.~ +119 -0
- data/schemas/mathml2/content/vector-calculus.xsd +88 -0
- data/schemas/mathml2/mathml2.xsd +59 -0
- data/schemas/mathml2/presentation/CVS/Entries +12 -0
- data/schemas/mathml2/presentation/CVS/Repository +1 -0
- data/schemas/mathml2/presentation/CVS/Root +1 -0
- data/schemas/mathml2/presentation/action.xsd +44 -0
- data/schemas/mathml2/presentation/characters.xsd +37 -0
- data/schemas/mathml2/presentation/common-attribs.xsd +113 -0
- data/schemas/mathml2/presentation/common-types.xsd +103 -0
- data/schemas/mathml2/presentation/error.xsd +40 -0
- data/schemas/mathml2/presentation/layout.xsd +195 -0
- data/schemas/mathml2/presentation/scripts.xsd +186 -0
- data/schemas/mathml2/presentation/space.xsd +52 -0
- data/schemas/mathml2/presentation/style.xsd +69 -0
- data/schemas/mathml2/presentation/table.xsd +216 -0
- data/schemas/mathml2/presentation/tokens.xsd +124 -0
- data/schemas/mathml3/mathml3-common.xsd +99 -0
- data/schemas/mathml3/mathml3-content.xsd +684 -0
- data/schemas/mathml3/mathml3-presentation.xsd +2151 -0
- data/schemas/mathml3/mathml3-strict-content.xsd +186 -0
- data/schemas/mathml3/mathml3.xsd +9 -0
- metadata +250 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb306bb25f97a7fb6562b604f7f31a7301a06133efbac3011e7de508556f37a3
|
|
4
|
+
data.tar.gz: 2a928b1ffaa1d6273bd6a47825e9d7c395d395a38eb06588f906901d4cb50dbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7a14d5f681eaafffc8c9863b048c6cb4583385aac027d5612ea21c019de8da79690f888a268f622b244fdfb8324a5bd6ce085783759b28569a5f76f2dac8f32
|
|
7
|
+
data.tar.gz: 187c9be72bc5cd64788ae64d9208fcb035c772ba1072e7894a8bea4ae16398be5f1446ef6080ae0a269723336dbb4b157760c1bd3e7f346bceb0d334379e3a04
|
data/.gitmodules
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[submodule "spec/fixtures/mml2-testsuite"]
|
|
2
|
+
path = spec/fixtures/mml2-testsuite
|
|
3
|
+
url = https://github.com/plurimath/mml2-testsuite.git
|
|
4
|
+
[submodule "spec/fixtures/mml3-testsuite"]
|
|
5
|
+
path = spec/fixtures/mml3-testsuite
|
|
6
|
+
url = https://github.com/plurimath/mml3-testsuite.git
|
|
7
|
+
[submodule "spec/fixtures/mmlcore-testsuite"]
|
|
8
|
+
path = spec/fixtures/mmlcore-testsuite
|
|
9
|
+
url = https://github.com/plurimath/mmlcore-testsuite.git
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,49 +1,53 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-04-
|
|
3
|
+
# on 2026-04-10 10:04:19 UTC using RuboCop version 1.86.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
9
|
+
# Offense count: 114
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
11
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
12
12
|
# URISchemes: http, https
|
|
13
13
|
Layout/LineLength:
|
|
14
|
+
Enabled: false
|
|
15
|
+
|
|
16
|
+
# Offense count: 1
|
|
17
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
18
|
+
Lint/UselessAssignment:
|
|
14
19
|
Exclude:
|
|
15
|
-
- 'mml.
|
|
16
|
-
- 'spec/mml_spec.rb'
|
|
17
|
-
- 'spec/spec_helper.rb'
|
|
20
|
+
- 'lib/mml/context_configuration.rb'
|
|
18
21
|
|
|
19
|
-
# Offense count:
|
|
22
|
+
# Offense count: 23
|
|
20
23
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
21
24
|
Metrics/AbcSize:
|
|
22
25
|
Enabled: false
|
|
23
26
|
|
|
24
|
-
# Offense count:
|
|
27
|
+
# Offense count: 11
|
|
25
28
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
|
26
29
|
# AllowedMethods: refine
|
|
27
30
|
Metrics/BlockLength:
|
|
28
|
-
Max:
|
|
31
|
+
Max: 167
|
|
29
32
|
|
|
30
|
-
# Offense count:
|
|
33
|
+
# Offense count: 55
|
|
31
34
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
32
35
|
Metrics/MethodLength:
|
|
33
|
-
Max:
|
|
34
|
-
|
|
35
|
-
# Offense count: 2
|
|
36
|
-
# Configuration parameters: Prefixes, AllowedPatterns.
|
|
37
|
-
# Prefixes: when, with, without
|
|
38
|
-
RSpec/ContextWording:
|
|
39
|
-
Exclude:
|
|
40
|
-
- 'spec/mml4_spec.rb'
|
|
41
|
-
- 'spec/mml_spec.rb'
|
|
36
|
+
Max: 170
|
|
42
37
|
|
|
43
38
|
# Offense count: 1
|
|
44
|
-
|
|
39
|
+
Naming/ConstantName:
|
|
45
40
|
Exclude:
|
|
46
|
-
- '
|
|
41
|
+
- 'lib/mml/v2/namespace.rb'
|
|
42
|
+
|
|
43
|
+
# Offense count: 35
|
|
44
|
+
# Configuration parameters: CountAsOne.
|
|
45
|
+
RSpec/ExampleLength:
|
|
46
|
+
Max: 11
|
|
47
|
+
|
|
48
|
+
# Offense count: 18
|
|
49
|
+
RSpec/MultipleExpectations:
|
|
50
|
+
Max: 3
|
|
47
51
|
|
|
48
52
|
# Offense count: 1
|
|
49
53
|
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
|
|
@@ -51,4 +55,9 @@ RSpec/MultipleDescribes:
|
|
|
51
55
|
RSpec/SpecFilePathFormat:
|
|
52
56
|
Exclude:
|
|
53
57
|
- '**/spec/routing/**/*'
|
|
54
|
-
- 'spec/
|
|
58
|
+
- 'spec/mml/v3/mnone_spec.rb'
|
|
59
|
+
|
|
60
|
+
# Offense count: 1
|
|
61
|
+
RSpec/UnspecifiedException:
|
|
62
|
+
Exclude:
|
|
63
|
+
- 'spec/mml/v3_spec.rb'
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -53,69 +53,68 @@ Mml::V4.parse(input)
|
|
|
53
53
|
|
|
54
54
|
== MathML version architecture
|
|
55
55
|
|
|
56
|
-
Mml maintains
|
|
57
|
-
|
|
58
|
-
for backward compatibility.
|
|
56
|
+
Mml maintains three parallel class hierarchies under `Mml::V2`, `Mml::V3`, and `Mml::V4`.
|
|
57
|
+
All versions share the same namespace URI (`http://www.w3.org/1998/Math/MathML`).
|
|
59
58
|
|
|
60
59
|
[source]
|
|
61
60
|
----
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
┌────┴────┐
|
|
70
|
-
│ Mml::V3 │
|
|
71
|
-
└────┬────┘
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
61
|
+
┌───────────────────────────────────────────┐
|
|
62
|
+
│ Mml │
|
|
63
|
+
│ parse() delegates to V2 / V3 / V4 │
|
|
64
|
+
└────────────────────┬──────────────────────┘
|
|
65
|
+
│
|
|
66
|
+
┌─────────────────────────┼─────────────────────────┐
|
|
67
|
+
│ │ │
|
|
68
|
+
┌────┴────┐ ┌────┴────┐ ┌────┴────┐
|
|
69
|
+
│ Mml::V2 │ │ Mml::V3 │ │ Mml::V4 │
|
|
70
|
+
└────┬────┘ └────┬────┘ └────┬────┘
|
|
71
|
+
│ │ │
|
|
72
|
+
┌──────────┴──────────┐ ┌──────────┴──────────┐ ┌──────────┴──────────┐
|
|
73
|
+
│ V2-only classes │ │ Shared │ │ V4-only classes │
|
|
74
|
+
│ (declare, reln, …) │ │ Base::modules │ │ + intent, arg, │
|
|
75
|
+
└─────────────────────┘ └─────────────────────┘ │ displaystyle, │
|
|
76
|
+
│ scriptlevel, │
|
|
77
|
+
│ + <a> element │
|
|
78
|
+
└─────────────────────┘
|
|
79
|
+
|
|
80
|
+
┌───────────────────────────────┐
|
|
81
|
+
│ lib/mml/base/ │
|
|
82
|
+
│ (shared attributes) │
|
|
83
|
+
└───────────────────────────────┘
|
|
84
|
+
----
|
|
85
|
+
|
|
86
|
+
**V2** (`lib/mml/v2/`): Standalone class hierarchy with full Content MathML support.
|
|
87
|
+
Includes deprecated elements like `declare` and `reln` not present in V3/V4.
|
|
88
|
+
|
|
89
|
+
**V3** (`lib/mml/v3/`): Uses shared `lib/mml/base/` modules for presentation elements.
|
|
90
|
+
Adds `overflow` attribute and V3-specific features.
|
|
91
|
+
|
|
92
|
+
**V4** (`lib/mml/v4/`): Uses shared `lib/mml/base/` modules with V4-only attributes
|
|
93
|
+
(`intent`, `arg`, `displaystyle`, `scriptlevel`) and the `<a>` hyperlink element.
|
|
93
94
|
|
|
94
95
|
=== Version selection
|
|
95
96
|
|
|
96
97
|
[source,ruby]
|
|
97
98
|
----
|
|
98
99
|
Mml.parse(input) # Default: MathML 3 (Mml::V3)
|
|
100
|
+
Mml.parse(input, version: 2) # Explicit MathML 2
|
|
99
101
|
Mml.parse(input, version: 3) # Explicit MathML 3
|
|
100
|
-
Mml.parse(input, version: 4) # MathML 4
|
|
102
|
+
Mml.parse(input, version: 4) # Explicit MathML 4
|
|
103
|
+
Mml::V2.parse(input) # Direct v2 parsing
|
|
101
104
|
Mml::V3.parse(input) # Direct v3 parsing
|
|
102
105
|
Mml::V4.parse(input) # Direct v4 parsing
|
|
103
106
|
----
|
|
104
107
|
|
|
105
|
-
=== Key differences between MathML 3 and
|
|
108
|
+
=== Key differences between MathML 2, 3 and 4
|
|
106
109
|
|
|
107
|
-
[cols="1,2",options="header"]
|
|
110
|
+
[cols="1,2,2",options="header"]
|
|
108
111
|
|===
|
|
109
|
-
|Feature |MathML 4 additions
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
* `index` on `mglyph`
|
|
116
|
-
|
|
117
|
-
See https://github.com/w3c/mathml/issues/5[w3c/mathml#5] and
|
|
118
|
-
https://github.com/w3c/mathml/issues/303[w3c/mathml#303] for details.
|
|
112
|
+
|Feature |MathML 3 additions |MathML 4 additions
|
|
113
|
+
|V3-only attributes |`overflow`, `linebreakmultchar` |-
|
|
114
|
+
|V4-universal attributes |- |`intent`, `arg`, `displaystyle`, `scriptlevel`
|
|
115
|
+
|V4 hyperlink element |- |`<a>` with `href`, `hreflang`
|
|
116
|
+
|V2 deprecated elements |`declare`, `reln`, `fn` |`declare`, `reln`, `fn`
|
|
117
|
+
|Deprecated font attrs |`fontfamily`, `fontweight`, etc. |removed from strict V4
|
|
119
118
|
|===
|
|
120
119
|
|
|
121
120
|
=== Migration from previous versions
|
|
@@ -332,6 +331,31 @@ Mml::V4::A.new(
|
|
|
332
331
|
# => <a href="https://example.com" hreflang="en"><mi>click</mi></a>
|
|
333
332
|
----
|
|
334
333
|
|
|
334
|
+
== MathML V2 Support
|
|
335
|
+
|
|
336
|
+
V2 is a standalone implementation with its own class hierarchy in `lib/mml/v2/`.
|
|
337
|
+
It includes full Content MathML support with elements not present in V3/V4:
|
|
338
|
+
|
|
339
|
+
[source,ruby]
|
|
340
|
+
----
|
|
341
|
+
# Parse MathML 2
|
|
342
|
+
Mml::V2.parse('<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi></math>')
|
|
343
|
+
|
|
344
|
+
# Content elements available in V2 (deprecated in V3/V4)
|
|
345
|
+
Mml::V2::Declare.new(...)
|
|
346
|
+
Mml::V2::Reln.new(...)
|
|
347
|
+
Mml::V2::Fn.new(...)
|
|
348
|
+
----
|
|
349
|
+
|
|
350
|
+
V2 uses `Mml::V2::Configuration` for context management:
|
|
351
|
+
|
|
352
|
+
[source,ruby]
|
|
353
|
+
----
|
|
354
|
+
Mml::V2::Configuration.context_id # => :mml_v2
|
|
355
|
+
Mml::V2::Configuration.context
|
|
356
|
+
Mml::V2::Configuration.populate_context!
|
|
357
|
+
----
|
|
358
|
+
|
|
335
359
|
== MathML V4 Compliance
|
|
336
360
|
|
|
337
361
|
This implementation has been audited against the
|
|
@@ -491,6 +515,111 @@ and is normalized to a context id internally.
|
|
|
491
515
|
If you reset global contexts and need the built-in MML contexts restored
|
|
492
516
|
explicitly, call `populate_context!` for the version(s) you want to restore.
|
|
493
517
|
|
|
518
|
+
== Unsupported Features
|
|
519
|
+
|
|
520
|
+
The following MathML test suite files are intentionally skipped (not failures) because
|
|
521
|
+
they use features that are not part of the MathML namespace:
|
|
522
|
+
|
|
523
|
+
[cols="1,3,1",options="header"]
|
|
524
|
+
|===
|
|
525
|
+
|Feature |Reason |Approx. Tests Skipped
|
|
526
|
+
|HTML attributes (`style`, `class`, `id`, `dir`, `mode`, `tabindex`, `data-*`, event handlers) |These are HTML/XML attributes, not MathML attributes |Varies by test suite
|
|
527
|
+
|HTML `<span>` elements |HTML elements are not part of MathML namespace |Varies by test suite
|
|
528
|
+
|XML comments |XML comments inside MathML elements are not supported |Varies by test suite
|
|
529
|
+
|Foreign content in `annotation-xml` |SVG, XHTML content inside annotation-xml is not supported |Varies by test suite
|
|
530
|
+
|Entity references |Named entity references other than standard XML entities |Varies by test suite
|
|
531
|
+
|===
|
|
532
|
+
|
|
533
|
+
These tests are filtered out via `UNSUPPORTED_PATTERNS` in the test configuration
|
|
534
|
+
and do not represent bugs. They are marked as "pending" in test output because
|
|
535
|
+
RSpec's `skip` directive still records them as pending tests.
|
|
536
|
+
|
|
537
|
+
== Version-Specific Attributes
|
|
538
|
+
|
|
539
|
+
Some MathML attributes are version-specific and only available on the appropriate version:
|
|
540
|
+
|
|
541
|
+
[cols="1,1,2",options="header"]
|
|
542
|
+
|===
|
|
543
|
+
|Attribute |Element |Notes
|
|
544
|
+
|`overflow` |`math` |MathML 3 only (line overflow behavior)
|
|
545
|
+
|`linebreakmultchar` |`math` |MathML 3 only (line break character)
|
|
546
|
+
|`scriptsizemultiplier` |`mscarries` |Float type for fractional scaling
|
|
547
|
+
|===
|
|
548
|
+
|
|
549
|
+
== Content Elements
|
|
550
|
+
|
|
551
|
+
The following Content MathML elements are supported for cross-content markup:
|
|
552
|
+
|
|
553
|
+
* `cn` - numeric content
|
|
554
|
+
* `ci` - identifier content
|
|
555
|
+
* `csymbol` - symbolic content (with presentation element support: `msub`, `msup`, `mrow`, etc.)
|
|
556
|
+
* `cs` - string content
|
|
557
|
+
* `cbytes` - bytes content with encoding attribute
|
|
558
|
+
* `apply`, `bind`, `bvar` - function application and binding
|
|
559
|
+
* `semantics`, `annotation`, `annotation-xml` - semantic annotations
|
|
560
|
+
|
|
561
|
+
== Test Suite and Fixtures
|
|
562
|
+
|
|
563
|
+
The gem uses multiple MathML test suites to validate parsing and serialization:
|
|
564
|
+
|
|
565
|
+
[cols="1,1,3",options="header"]
|
|
566
|
+
|===
|
|
567
|
+
|Test Suite |Version |Description
|
|
568
|
+
|`spec/fixtures/mml2-testsuite/` |V2 |W3C MathML 2 test suite with Content and Presentation elements
|
|
569
|
+
|`spec/fixtures/mml3-testsuite/` |V3 |W3C MathML 3 test suite
|
|
570
|
+
|`spec/fixtures/mmlcore-testsuite/` |V4 |WPT MathML Core tests (modern browser implementation)
|
|
571
|
+
|`spec/fixtures/v2/`, `spec/fixtures/v4/` |V2/V4 |Hand-crafted fixtures for version-specific features
|
|
572
|
+
|===
|
|
573
|
+
|
|
574
|
+
=== Running Tests
|
|
575
|
+
|
|
576
|
+
[source,bash]
|
|
577
|
+
----
|
|
578
|
+
bundle exec rake # Run all specs + rubocop
|
|
579
|
+
bundle exec rspec # Run all tests
|
|
580
|
+
bundle exec rspec spec/mml/v3_spec.rb # Run specific test file
|
|
581
|
+
bundle exec rspec --only-failures # Run only previously failing tests
|
|
582
|
+
----
|
|
583
|
+
|
|
584
|
+
=== Test Fixture Processing
|
|
585
|
+
|
|
586
|
+
Some test suites require preprocessing to extract clean MathML from HTML wrappers:
|
|
587
|
+
|
|
588
|
+
[source,bash]
|
|
589
|
+
----
|
|
590
|
+
# Preprocess test fixtures (strips HTML wrappers, extracts MathML)
|
|
591
|
+
rake spec:preprocess_fixtures
|
|
592
|
+
|
|
593
|
+
# Validate preprocessed fixtures against XSD schemas
|
|
594
|
+
rake spec:validate_cleaned_fixtures
|
|
595
|
+
|
|
596
|
+
# Both in sequence
|
|
597
|
+
rake spec:prepare
|
|
598
|
+
----
|
|
599
|
+
|
|
600
|
+
The preprocessed fixtures are stored in `tmp/cleaned_fixtures/` and are excluded from git.
|
|
601
|
+
|
|
602
|
+
=== Unsupported Test Patterns
|
|
603
|
+
|
|
604
|
+
Tests are filtered via `UNSUPPORTED_PATTERNS` when they contain:
|
|
605
|
+
|
|
606
|
+
* HTML elements/attributes (`<span>`, `style=`, `class=`, etc.)
|
|
607
|
+
* XML comments inside elements
|
|
608
|
+
* Foreign content (SVG in `annotation-xml`)
|
|
609
|
+
* Entity references not handled by the parser
|
|
610
|
+
* Content elements not supported in presentation context (V3/V4)
|
|
611
|
+
|
|
612
|
+
These are marked as pending, not failures, because they represent features outside the MathML namespace.
|
|
613
|
+
|
|
614
|
+
=== Known Pending Issues
|
|
615
|
+
|
|
616
|
+
[cols="1,3",options="header"]
|
|
617
|
+
|===
|
|
618
|
+
|Issue |Affected Tests
|
|
619
|
+
|lutaml-model Unicode NCR comparison |V2 tests with ` ` spacing characters
|
|
620
|
+
|Parser schema validation |V3 ErrorHandling tests (parser accepts invalid MathML)
|
|
621
|
+
|===
|
|
622
|
+
|
|
494
623
|
== Development
|
|
495
624
|
|
|
496
625
|
[source,bash]
|
data/Rakefile
CHANGED
|
@@ -6,7 +6,22 @@ require "rspec/core/rake_task"
|
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
|
7
7
|
|
|
8
8
|
require "rubocop/rake_task"
|
|
9
|
-
|
|
10
9
|
RuboCop::RakeTask.new
|
|
11
10
|
|
|
11
|
+
# Spec preparation tasks
|
|
12
|
+
namespace :spec do
|
|
13
|
+
desc "Preprocess MathML fixture files to clean them"
|
|
14
|
+
task :preprocess_fixtures do
|
|
15
|
+
load "spec/tasks/preprocess_fixtures.rb"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc "Validate cleaned fixtures against XSD schemas"
|
|
19
|
+
task :validate_cleaned_fixtures do
|
|
20
|
+
load "spec/tasks/validate_cleaned_fixtures.rb"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "Prepare spec fixtures (preprocess + validate)"
|
|
24
|
+
task prepare: %i[preprocess_fixtures validate_cleaned_fixtures]
|
|
25
|
+
end
|
|
26
|
+
|
|
12
27
|
task default: %i[spec rubocop]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mml
|
|
4
|
+
module Base
|
|
5
|
+
module Content
|
|
6
|
+
# annotation is a non-XML annotation for semantic markup.
|
|
7
|
+
# Used within semantics element.
|
|
8
|
+
module Annotation
|
|
9
|
+
def self.included(klass)
|
|
10
|
+
klass.class_eval do
|
|
11
|
+
attribute :definition_url, :string
|
|
12
|
+
attribute :encoding_value, :string
|
|
13
|
+
attribute :href, :string
|
|
14
|
+
attribute :value, :string
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Mml::Namespace
|
|
18
|
+
element "annotation"
|
|
19
|
+
|
|
20
|
+
map_content to: :value
|
|
21
|
+
map_attribute "href", to: :href
|
|
22
|
+
map_attribute "definitionURL", to: :definition_url
|
|
23
|
+
map_attribute "encoding", to: :encoding_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mml
|
|
4
|
+
module Base
|
|
5
|
+
module Content
|
|
6
|
+
# annotation-xml is an XML-encoded annotation for semantic markup.
|
|
7
|
+
# Used within semantics element to embed presentation or other markup.
|
|
8
|
+
module AnnotationXml
|
|
9
|
+
def self.included(klass)
|
|
10
|
+
klass.class_eval do
|
|
11
|
+
attribute :definitionURL, :string
|
|
12
|
+
attribute :annotation_xml_encoding, :string
|
|
13
|
+
attribute :cd, :string
|
|
14
|
+
attribute :name, :string
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
namespace Mml::Namespace
|
|
18
|
+
element "annotation-xml"
|
|
19
|
+
mixed_content
|
|
20
|
+
|
|
21
|
+
map_attribute "definitionURL", to: :definitionURL
|
|
22
|
+
map_attribute "encoding", to: :annotation_xml_encoding
|
|
23
|
+
map_attribute "cd", to: :cd
|
|
24
|
+
map_attribute "name", to: :name
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mml
|
|
4
|
+
module Base
|
|
5
|
+
module Content
|
|
6
|
+
# The apply element applies a function to its arguments.
|
|
7
|
+
# First child is the operator, remaining children are operands.
|
|
8
|
+
module Apply
|
|
9
|
+
def self.included(klass)
|
|
10
|
+
klass.class_eval do
|
|
11
|
+
attribute :definition_url, :string
|
|
12
|
+
attribute :encoding_value, :string
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
namespace Mml::Namespace
|
|
16
|
+
element "apply"
|
|
17
|
+
mixed_content
|
|
18
|
+
|
|
19
|
+
map_attribute "definitionURL", to: :definition_url
|
|
20
|
+
map_attribute "encoding", to: :encoding_value
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|