asciimath 1.0.9 → 2.0.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.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ci.yml +20 -0
  3. data/AST.adoc +457 -0
  4. data/CHANGELOG.adoc +47 -1
  5. data/Gemfile +5 -0
  6. data/README.adoc +68 -4
  7. data/asciimath.gemspec +3 -6
  8. data/dump_symbol_table.rb +46 -0
  9. data/lib/asciimath.rb +5 -4
  10. data/lib/asciimath/ast.rb +456 -0
  11. data/lib/asciimath/cli.rb +4 -1
  12. data/lib/asciimath/color_table.rb +21 -0
  13. data/lib/asciimath/html.rb +128 -112
  14. data/lib/asciimath/latex.rb +399 -0
  15. data/lib/asciimath/markup.rb +509 -0
  16. data/lib/asciimath/mathml.rb +206 -87
  17. data/lib/asciimath/parser.rb +510 -350
  18. data/lib/asciimath/symbol_table.rb +25 -0
  19. data/lib/asciimath/version.rb +1 -1
  20. data/spec/ast.rb +144 -0
  21. data/spec/customisation_spec.rb +28 -0
  22. data/spec/parser_spec.rb +623 -165
  23. data/spec/schema/mathml2/common/common-attribs.xsd +41 -0
  24. data/spec/schema/mathml2/common/math.xsd +126 -0
  25. data/spec/schema/mathml2/common/xlink-href.xsd +20 -0
  26. data/spec/schema/mathml2/content/arith.xsd +90 -0
  27. data/spec/schema/mathml2/content/calculus.xsd +146 -0
  28. data/spec/schema/mathml2/content/common-attrib.xsd +30 -0
  29. data/spec/schema/mathml2/content/constants.xsd +83 -0
  30. data/spec/schema/mathml2/content/constructs.xsd +260 -0
  31. data/spec/schema/mathml2/content/elementary-functions.xsd +117 -0
  32. data/spec/schema/mathml2/content/functions.xsd +73 -0
  33. data/spec/schema/mathml2/content/linear-algebra.xsd +173 -0
  34. data/spec/schema/mathml2/content/logic.xsd +53 -0
  35. data/spec/schema/mathml2/content/relations.xsd +55 -0
  36. data/spec/schema/mathml2/content/semantics.xsd +85 -0
  37. data/spec/schema/mathml2/content/sets.xsd +236 -0
  38. data/spec/schema/mathml2/content/statistics.xsd +136 -0
  39. data/spec/schema/mathml2/content/tokens.xsd +120 -0
  40. data/spec/schema/mathml2/content/vector-calculus.xsd +88 -0
  41. data/spec/schema/mathml2/mathml2.xsd +59 -0
  42. data/spec/schema/mathml2/presentation/action.xsd +44 -0
  43. data/spec/schema/mathml2/presentation/characters.xsd +37 -0
  44. data/spec/schema/mathml2/presentation/common-attribs.xsd +113 -0
  45. data/spec/schema/mathml2/presentation/common-types.xsd +103 -0
  46. data/spec/schema/mathml2/presentation/error.xsd +40 -0
  47. data/spec/schema/mathml2/presentation/layout.xsd +195 -0
  48. data/spec/schema/mathml2/presentation/scripts.xsd +186 -0
  49. data/spec/schema/mathml2/presentation/space.xsd +52 -0
  50. data/spec/schema/mathml2/presentation/style.xsd +69 -0
  51. data/spec/schema/mathml2/presentation/table.xsd +216 -0
  52. data/spec/schema/mathml2/presentation/tokens.xsd +124 -0
  53. data/spec/schema/mathml3/mathml3-common.xsd +99 -0
  54. data/spec/schema/mathml3/mathml3-content.xsd +684 -0
  55. data/spec/schema/mathml3/mathml3-presentation.xsd +2151 -0
  56. data/spec/schema/mathml3/mathml3-strict-content.xsd +186 -0
  57. data/spec/schema/mathml3/mathml3.xsd +9 -0
  58. metadata +88 -48
  59. data/.travis.yml +0 -18
@@ -0,0 +1,186 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:m="http://www.w3.org/1998/Math/MathML"
4
+ elementFormDefault="qualified"
5
+ targetNamespace="http://www.w3.org/1998/Math/MathML">
6
+ <xs:group name="ContExp">
7
+ <xs:choice>
8
+ <!--Ambiguous content model altered (ContExp)-->
9
+ <xs:element ref="m:apply"/>
10
+ <xs:element ref="m:bind"/>
11
+ <xs:element ref="m:ci"/>
12
+ <xs:element ref="m:cn"/>
13
+ <xs:element ref="m:csymbol"/>
14
+ <xs:element ref="m:cbytes"/>
15
+ <xs:element ref="m:cerror"/>
16
+ <xs:element ref="m:cs"/>
17
+ <xs:element ref="m:share"/>
18
+ <xs:element ref="m:piecewise"/>
19
+ <xs:element ref="m:DeprecatedContExp"/>
20
+ <xs:element ref="m:interval.class"/>
21
+ <xs:element ref="m:unary-functional.class"/>
22
+ <xs:element ref="m:lambda.class"/>
23
+ <xs:element ref="m:nary-functional.class"/>
24
+ <xs:group ref="m:binary-arith.class"/>
25
+ <xs:group ref="m:unary-arith.class"/>
26
+ <xs:element ref="m:nary-minmax.class"/>
27
+ <xs:element ref="m:nary-arith.class"/>
28
+ <xs:element ref="m:nary-logical.class"/>
29
+ <xs:element ref="m:unary-logical.class"/>
30
+ <xs:element ref="m:binary-logical.class"/>
31
+ <xs:element ref="m:quantifier.class"/>
32
+ <xs:element ref="m:nary-reln.class"/>
33
+ <xs:element ref="m:binary-reln.class"/>
34
+ <xs:element ref="m:int.class"/>
35
+ <xs:element ref="m:Differential-Operator.class"/>
36
+ <xs:element ref="m:partialdiff.class"/>
37
+ <xs:element ref="m:unary-veccalc.class"/>
38
+ <xs:element ref="m:nary-setlist-constructor.class"/>
39
+ <xs:element ref="m:nary-set.class"/>
40
+ <xs:element ref="m:binary-set.class"/>
41
+ <xs:element ref="m:nary-set-reln.class"/>
42
+ <xs:element ref="m:unary-set.class"/>
43
+ <xs:element ref="m:sum.class"/>
44
+ <xs:element ref="m:product.class"/>
45
+ <xs:element ref="m:limit.class"/>
46
+ <xs:element ref="m:unary-elementary.class"/>
47
+ <xs:element ref="m:nary-stats.class"/>
48
+ <xs:element ref="m:nary-constructor.class"/>
49
+ <xs:element ref="m:unary-linalg.class"/>
50
+ <xs:element ref="m:nary-linalg.class"/>
51
+ <xs:element ref="m:binary-linalg.class"/>
52
+ <xs:element ref="m:constant-set.class"/>
53
+ <xs:element ref="m:constant-arith.class"/>
54
+ </xs:choice>
55
+ </xs:group>
56
+ <xs:element name="cn">
57
+ <xs:complexType>
58
+ <xs:complexContent>
59
+ <xs:extension base="m:cn.content">
60
+ <xs:attributeGroup ref="m:cn.attributes"/>
61
+ </xs:extension>
62
+ </xs:complexContent>
63
+ </xs:complexType>
64
+ </xs:element>
65
+ <xs:group name="semantics-ci">
66
+ <xs:sequence>
67
+ <xs:element name="semantics">
68
+ <xs:complexType>
69
+ <xs:sequence>
70
+ <xs:choice>
71
+ <xs:element ref="m:ci"/>
72
+ <xs:group ref="m:semantics-ci"/>
73
+ </xs:choice>
74
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
75
+ <xs:element ref="m:annotation"/>
76
+ <xs:element ref="m:annotation-xml"/>
77
+ </xs:choice>
78
+ </xs:sequence>
79
+ <xs:attributeGroup ref="m:semantics.attributes"/>
80
+ </xs:complexType>
81
+ </xs:element>
82
+ </xs:sequence>
83
+ </xs:group>
84
+ <xs:group name="semantics-contexp">
85
+ <xs:sequence>
86
+ <xs:element name="semantics">
87
+ <xs:complexType>
88
+ <xs:sequence>
89
+ <xs:group ref="m:ContExp"/>
90
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
91
+ <xs:element ref="m:annotation"/>
92
+ <xs:element ref="m:annotation-xml"/>
93
+ </xs:choice>
94
+ </xs:sequence>
95
+ <xs:attributeGroup ref="m:semantics.attributes"/>
96
+ </xs:complexType>
97
+ </xs:element>
98
+ </xs:sequence>
99
+ </xs:group>
100
+ <xs:element name="ci">
101
+ <xs:complexType>
102
+ <xs:complexContent>
103
+ <xs:extension base="m:ci.content">
104
+ <xs:attributeGroup ref="m:ci.attributes"/>
105
+ </xs:extension>
106
+ </xs:complexContent>
107
+ </xs:complexType>
108
+ </xs:element>
109
+ <xs:element name="csymbol">
110
+ <xs:complexType>
111
+ <xs:complexContent>
112
+ <xs:extension base="m:csymbol.content">
113
+ <xs:attributeGroup ref="m:csymbol.attributes"/>
114
+ </xs:extension>
115
+ </xs:complexContent>
116
+ </xs:complexType>
117
+ </xs:element>
118
+ <xs:simpleType name="SymbolName">
119
+ <xs:restriction base="xs:NCName"/>
120
+ </xs:simpleType>
121
+ <xs:group name="BvarQ">
122
+ <xs:sequence>
123
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="m:bvar"/>
124
+ </xs:sequence>
125
+ </xs:group>
126
+ <xs:element name="apply">
127
+ <xs:complexType>
128
+ <xs:complexContent>
129
+ <xs:extension base="m:apply.content">
130
+ <xs:attributeGroup ref="m:CommonAtt"/>
131
+ </xs:extension>
132
+ </xs:complexContent>
133
+ </xs:complexType>
134
+ </xs:element>
135
+ <xs:element name="bind">
136
+ <xs:complexType>
137
+ <xs:complexContent>
138
+ <xs:extension base="m:bind.content">
139
+ <xs:attributeGroup ref="m:CommonAtt"/>
140
+ </xs:extension>
141
+ </xs:complexContent>
142
+ </xs:complexType>
143
+ </xs:element>
144
+ <xs:element name="share">
145
+ <xs:complexType>
146
+ <xs:attributeGroup ref="m:CommonAtt"/>
147
+ <xs:attributeGroup ref="m:src"/>
148
+ </xs:complexType>
149
+ </xs:element>
150
+ <xs:element name="cerror">
151
+ <xs:complexType>
152
+ <xs:sequence>
153
+ <xs:element ref="m:csymbol"/>
154
+ <xs:group minOccurs="0" maxOccurs="unbounded" ref="m:ContExp"/>
155
+ </xs:sequence>
156
+ <xs:attributeGroup ref="m:cerror.attributes"/>
157
+ </xs:complexType>
158
+ </xs:element>
159
+ <xs:attributeGroup name="cerror.attributes">
160
+ <xs:attributeGroup ref="m:CommonAtt"/>
161
+ </xs:attributeGroup>
162
+ <xs:element name="cbytes">
163
+ <xs:complexType>
164
+ <xs:simpleContent>
165
+ <xs:extension base="m:base64">
166
+ <xs:attributeGroup ref="m:cbytes.attributes"/>
167
+ </xs:extension>
168
+ </xs:simpleContent>
169
+ </xs:complexType>
170
+ </xs:element>
171
+ <xs:simpleType name="base64">
172
+ <xs:restriction base="xs:base64Binary"/>
173
+ </xs:simpleType>
174
+ <xs:element name="cs">
175
+ <xs:complexType mixed="true">
176
+ <xs:attributeGroup ref="m:cs.attributes"/>
177
+ </xs:complexType>
178
+ </xs:element>
179
+ <xs:group name="MathExpression">
180
+ <xs:choice>
181
+ <xs:group ref="m:ContExp"/>
182
+ <xs:element ref="m:PresentationExpression"/>
183
+ <xs:group ref="m:semantics"/>
184
+ </xs:choice>
185
+ </xs:group>
186
+ </xs:schema>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:m="http://www.w3.org/1998/Math/MathML"
4
+ elementFormDefault="qualified"
5
+ targetNamespace="http://www.w3.org/1998/Math/MathML">
6
+ <xs:include schemaLocation="mathml3-content.xsd"/>
7
+ <xs:include schemaLocation="mathml3-presentation.xsd"/>
8
+ <xs:include schemaLocation="mathml3-common.xsd"/>
9
+ </xs:schema>
metadata CHANGED
@@ -1,67 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pepijn Van Eeckhoudt
8
+ - Gark Garcia
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2019-10-26 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">"
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">"
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 3.1.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 3.1.0
12
+ date: 2021-07-26 00:00:00.000000000 Z
13
+ dependencies: []
55
14
  description: A pure Ruby AsciiMath parsing and conversion library.
56
15
  email:
57
16
  - pepijn@vaneeckhoudt.net
17
+ - pablo-ecobar@riseup.net
58
18
  executables:
59
19
  - asciimath
60
20
  extensions: []
61
21
  extra_rdoc_files: []
62
22
  files:
23
+ - ".github/workflows/ci.yml"
63
24
  - ".gitignore"
64
- - ".travis.yml"
25
+ - AST.adoc
65
26
  - CHANGELOG.adoc
66
27
  - Gemfile
67
28
  - LICENSE.txt
@@ -69,13 +30,56 @@ files:
69
30
  - Rakefile
70
31
  - asciimath.gemspec
71
32
  - bin/asciimath
33
+ - dump_symbol_table.rb
72
34
  - lib/asciimath.rb
35
+ - lib/asciimath/ast.rb
73
36
  - lib/asciimath/cli.rb
37
+ - lib/asciimath/color_table.rb
74
38
  - lib/asciimath/html.rb
39
+ - lib/asciimath/latex.rb
40
+ - lib/asciimath/markup.rb
75
41
  - lib/asciimath/mathml.rb
76
42
  - lib/asciimath/parser.rb
43
+ - lib/asciimath/symbol_table.rb
77
44
  - lib/asciimath/version.rb
45
+ - spec/ast.rb
46
+ - spec/customisation_spec.rb
78
47
  - spec/parser_spec.rb
48
+ - spec/schema/mathml2/common/common-attribs.xsd
49
+ - spec/schema/mathml2/common/math.xsd
50
+ - spec/schema/mathml2/common/xlink-href.xsd
51
+ - spec/schema/mathml2/content/arith.xsd
52
+ - spec/schema/mathml2/content/calculus.xsd
53
+ - spec/schema/mathml2/content/common-attrib.xsd
54
+ - spec/schema/mathml2/content/constants.xsd
55
+ - spec/schema/mathml2/content/constructs.xsd
56
+ - spec/schema/mathml2/content/elementary-functions.xsd
57
+ - spec/schema/mathml2/content/functions.xsd
58
+ - spec/schema/mathml2/content/linear-algebra.xsd
59
+ - spec/schema/mathml2/content/logic.xsd
60
+ - spec/schema/mathml2/content/relations.xsd
61
+ - spec/schema/mathml2/content/semantics.xsd
62
+ - spec/schema/mathml2/content/sets.xsd
63
+ - spec/schema/mathml2/content/statistics.xsd
64
+ - spec/schema/mathml2/content/tokens.xsd
65
+ - spec/schema/mathml2/content/vector-calculus.xsd
66
+ - spec/schema/mathml2/mathml2.xsd
67
+ - spec/schema/mathml2/presentation/action.xsd
68
+ - spec/schema/mathml2/presentation/characters.xsd
69
+ - spec/schema/mathml2/presentation/common-attribs.xsd
70
+ - spec/schema/mathml2/presentation/common-types.xsd
71
+ - spec/schema/mathml2/presentation/error.xsd
72
+ - spec/schema/mathml2/presentation/layout.xsd
73
+ - spec/schema/mathml2/presentation/scripts.xsd
74
+ - spec/schema/mathml2/presentation/space.xsd
75
+ - spec/schema/mathml2/presentation/style.xsd
76
+ - spec/schema/mathml2/presentation/table.xsd
77
+ - spec/schema/mathml2/presentation/tokens.xsd
78
+ - spec/schema/mathml3/mathml3-common.xsd
79
+ - spec/schema/mathml3/mathml3-content.xsd
80
+ - spec/schema/mathml3/mathml3-presentation.xsd
81
+ - spec/schema/mathml3/mathml3-strict-content.xsd
82
+ - spec/schema/mathml3/mathml3.xsd
79
83
  - style/math.css
80
84
  homepage: ''
81
85
  licenses:
@@ -96,10 +100,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
100
  - !ruby/object:Gem::Version
97
101
  version: '0'
98
102
  requirements: []
99
- rubyforge_project:
100
- rubygems_version: 2.5.1
103
+ rubygems_version: 3.1.4
101
104
  signing_key:
102
105
  specification_version: 4
103
106
  summary: AsciiMath parser and converter
104
107
  test_files:
108
+ - spec/ast.rb
109
+ - spec/customisation_spec.rb
105
110
  - spec/parser_spec.rb
111
+ - spec/schema/mathml2/common/common-attribs.xsd
112
+ - spec/schema/mathml2/common/math.xsd
113
+ - spec/schema/mathml2/common/xlink-href.xsd
114
+ - spec/schema/mathml2/content/arith.xsd
115
+ - spec/schema/mathml2/content/calculus.xsd
116
+ - spec/schema/mathml2/content/common-attrib.xsd
117
+ - spec/schema/mathml2/content/constants.xsd
118
+ - spec/schema/mathml2/content/constructs.xsd
119
+ - spec/schema/mathml2/content/elementary-functions.xsd
120
+ - spec/schema/mathml2/content/functions.xsd
121
+ - spec/schema/mathml2/content/linear-algebra.xsd
122
+ - spec/schema/mathml2/content/logic.xsd
123
+ - spec/schema/mathml2/content/relations.xsd
124
+ - spec/schema/mathml2/content/semantics.xsd
125
+ - spec/schema/mathml2/content/sets.xsd
126
+ - spec/schema/mathml2/content/statistics.xsd
127
+ - spec/schema/mathml2/content/tokens.xsd
128
+ - spec/schema/mathml2/content/vector-calculus.xsd
129
+ - spec/schema/mathml2/mathml2.xsd
130
+ - spec/schema/mathml2/presentation/action.xsd
131
+ - spec/schema/mathml2/presentation/characters.xsd
132
+ - spec/schema/mathml2/presentation/common-attribs.xsd
133
+ - spec/schema/mathml2/presentation/common-types.xsd
134
+ - spec/schema/mathml2/presentation/error.xsd
135
+ - spec/schema/mathml2/presentation/layout.xsd
136
+ - spec/schema/mathml2/presentation/scripts.xsd
137
+ - spec/schema/mathml2/presentation/space.xsd
138
+ - spec/schema/mathml2/presentation/style.xsd
139
+ - spec/schema/mathml2/presentation/table.xsd
140
+ - spec/schema/mathml2/presentation/tokens.xsd
141
+ - spec/schema/mathml3/mathml3-common.xsd
142
+ - spec/schema/mathml3/mathml3-content.xsd
143
+ - spec/schema/mathml3/mathml3-presentation.xsd
144
+ - spec/schema/mathml3/mathml3-strict-content.xsd
145
+ - spec/schema/mathml3/mathml3.xsd
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- language: ruby
2
- cache:
3
- apt: true
4
- directories:
5
- - vendor/bundle
6
- - $HOME/.cache/pip
7
- rvm:
8
- - 1.9
9
- - 2.3
10
- - 2.4
11
- - 2.5
12
- - jruby-1.7.27
13
- - jruby
14
- - truffleruby
15
- before_install:
16
- - type bundle || gem install bundler --version '~> 1.0'
17
- install:
18
- - bundle install --path vendor/bundle --jobs=3 --retry=3