asciimath 1.0.7 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +26 -0
  3. data/AST.adoc +457 -0
  4. data/CHANGELOG.adoc +50 -2
  5. data/README.adoc +68 -4
  6. data/asciimath.gemspec +7 -5
  7. data/dump_symbol_table.rb +46 -0
  8. data/lib/asciimath.rb +5 -4
  9. data/lib/asciimath/ast.rb +456 -0
  10. data/lib/asciimath/cli.rb +4 -1
  11. data/lib/asciimath/color_table.rb +21 -0
  12. data/lib/asciimath/html.rb +141 -114
  13. data/lib/asciimath/latex.rb +399 -0
  14. data/lib/asciimath/markup.rb +501 -0
  15. data/lib/asciimath/mathml.rb +212 -83
  16. data/lib/asciimath/parser.rb +522 -336
  17. data/lib/asciimath/symbol_table.rb +25 -0
  18. data/lib/asciimath/version.rb +1 -1
  19. data/spec/ast.rb +144 -0
  20. data/spec/customisation_spec.rb +28 -0
  21. data/spec/parser_spec.rb +613 -154
  22. data/spec/schema/mathml2/common/common-attribs.xsd +41 -0
  23. data/spec/schema/mathml2/common/math.xsd +126 -0
  24. data/spec/schema/mathml2/common/xlink-href.xsd +20 -0
  25. data/spec/schema/mathml2/content/arith.xsd +90 -0
  26. data/spec/schema/mathml2/content/calculus.xsd +146 -0
  27. data/spec/schema/mathml2/content/common-attrib.xsd +30 -0
  28. data/spec/schema/mathml2/content/constants.xsd +83 -0
  29. data/spec/schema/mathml2/content/constructs.xsd +260 -0
  30. data/spec/schema/mathml2/content/elementary-functions.xsd +117 -0
  31. data/spec/schema/mathml2/content/functions.xsd +73 -0
  32. data/spec/schema/mathml2/content/linear-algebra.xsd +173 -0
  33. data/spec/schema/mathml2/content/logic.xsd +53 -0
  34. data/spec/schema/mathml2/content/relations.xsd +55 -0
  35. data/spec/schema/mathml2/content/semantics.xsd +85 -0
  36. data/spec/schema/mathml2/content/sets.xsd +236 -0
  37. data/spec/schema/mathml2/content/statistics.xsd +136 -0
  38. data/spec/schema/mathml2/content/tokens.xsd +120 -0
  39. data/spec/schema/mathml2/content/vector-calculus.xsd +88 -0
  40. data/spec/schema/mathml2/mathml2.xsd +59 -0
  41. data/spec/schema/mathml2/presentation/action.xsd +44 -0
  42. data/spec/schema/mathml2/presentation/characters.xsd +37 -0
  43. data/spec/schema/mathml2/presentation/common-attribs.xsd +113 -0
  44. data/spec/schema/mathml2/presentation/common-types.xsd +103 -0
  45. data/spec/schema/mathml2/presentation/error.xsd +40 -0
  46. data/spec/schema/mathml2/presentation/layout.xsd +195 -0
  47. data/spec/schema/mathml2/presentation/scripts.xsd +186 -0
  48. data/spec/schema/mathml2/presentation/space.xsd +52 -0
  49. data/spec/schema/mathml2/presentation/style.xsd +69 -0
  50. data/spec/schema/mathml2/presentation/table.xsd +216 -0
  51. data/spec/schema/mathml2/presentation/tokens.xsd +124 -0
  52. data/spec/schema/mathml3/mathml3-common.xsd +99 -0
  53. data/spec/schema/mathml3/mathml3-content.xsd +684 -0
  54. data/spec/schema/mathml3/mathml3-presentation.xsd +2151 -0
  55. data/spec/schema/mathml3/mathml3-strict-content.xsd +186 -0
  56. data/spec/schema/mathml3/mathml3.xsd +9 -0
  57. metadata +109 -13
  58. 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,84 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 2.0.2
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-01-06 00:00:00.000000000 Z
12
+ date: 2020-12-13 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - "~>"
18
+ - - ">"
18
19
  - !ruby/object:Gem::Version
19
- version: '1.6'
20
+ version: '0'
20
21
  type: :development
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - "~>"
25
+ - - ">"
25
26
  - !ruby/object:Gem::Version
26
- version: '1.6'
27
+ version: '0'
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: rake
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '10.0'
34
+ version: 13.0.0
34
35
  type: :development
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '10.0'
41
+ version: 13.0.0
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: rspec
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - "~>"
46
47
  - !ruby/object:Gem::Version
47
- version: 3.1.0
48
+ version: 3.9.0
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 3.9.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: nokogiri
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 1.10.9
48
63
  type: :development
49
64
  prerelease: false
50
65
  version_requirements: !ruby/object:Gem::Requirement
51
66
  requirements:
52
67
  - - "~>"
53
68
  - !ruby/object:Gem::Version
54
- version: 3.1.0
69
+ version: 1.10.9
55
70
  description: A pure Ruby AsciiMath parsing and conversion library.
56
71
  email:
57
72
  - pepijn@vaneeckhoudt.net
73
+ - pablo-ecobar@riseup.net
58
74
  executables:
59
75
  - asciimath
60
76
  extensions: []
61
77
  extra_rdoc_files: []
62
78
  files:
79
+ - ".github/workflows/ci.yml"
63
80
  - ".gitignore"
64
- - ".travis.yml"
81
+ - AST.adoc
65
82
  - CHANGELOG.adoc
66
83
  - Gemfile
67
84
  - LICENSE.txt
@@ -69,13 +86,56 @@ files:
69
86
  - Rakefile
70
87
  - asciimath.gemspec
71
88
  - bin/asciimath
89
+ - dump_symbol_table.rb
72
90
  - lib/asciimath.rb
91
+ - lib/asciimath/ast.rb
73
92
  - lib/asciimath/cli.rb
93
+ - lib/asciimath/color_table.rb
74
94
  - lib/asciimath/html.rb
95
+ - lib/asciimath/latex.rb
96
+ - lib/asciimath/markup.rb
75
97
  - lib/asciimath/mathml.rb
76
98
  - lib/asciimath/parser.rb
99
+ - lib/asciimath/symbol_table.rb
77
100
  - lib/asciimath/version.rb
101
+ - spec/ast.rb
102
+ - spec/customisation_spec.rb
78
103
  - spec/parser_spec.rb
104
+ - spec/schema/mathml2/common/common-attribs.xsd
105
+ - spec/schema/mathml2/common/math.xsd
106
+ - spec/schema/mathml2/common/xlink-href.xsd
107
+ - spec/schema/mathml2/content/arith.xsd
108
+ - spec/schema/mathml2/content/calculus.xsd
109
+ - spec/schema/mathml2/content/common-attrib.xsd
110
+ - spec/schema/mathml2/content/constants.xsd
111
+ - spec/schema/mathml2/content/constructs.xsd
112
+ - spec/schema/mathml2/content/elementary-functions.xsd
113
+ - spec/schema/mathml2/content/functions.xsd
114
+ - spec/schema/mathml2/content/linear-algebra.xsd
115
+ - spec/schema/mathml2/content/logic.xsd
116
+ - spec/schema/mathml2/content/relations.xsd
117
+ - spec/schema/mathml2/content/semantics.xsd
118
+ - spec/schema/mathml2/content/sets.xsd
119
+ - spec/schema/mathml2/content/statistics.xsd
120
+ - spec/schema/mathml2/content/tokens.xsd
121
+ - spec/schema/mathml2/content/vector-calculus.xsd
122
+ - spec/schema/mathml2/mathml2.xsd
123
+ - spec/schema/mathml2/presentation/action.xsd
124
+ - spec/schema/mathml2/presentation/characters.xsd
125
+ - spec/schema/mathml2/presentation/common-attribs.xsd
126
+ - spec/schema/mathml2/presentation/common-types.xsd
127
+ - spec/schema/mathml2/presentation/error.xsd
128
+ - spec/schema/mathml2/presentation/layout.xsd
129
+ - spec/schema/mathml2/presentation/scripts.xsd
130
+ - spec/schema/mathml2/presentation/space.xsd
131
+ - spec/schema/mathml2/presentation/style.xsd
132
+ - spec/schema/mathml2/presentation/table.xsd
133
+ - spec/schema/mathml2/presentation/tokens.xsd
134
+ - spec/schema/mathml3/mathml3-common.xsd
135
+ - spec/schema/mathml3/mathml3-content.xsd
136
+ - spec/schema/mathml3/mathml3-presentation.xsd
137
+ - spec/schema/mathml3/mathml3-strict-content.xsd
138
+ - spec/schema/mathml3/mathml3.xsd
79
139
  - style/math.css
80
140
  homepage: ''
81
141
  licenses:
@@ -96,10 +156,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
156
  - !ruby/object:Gem::Version
97
157
  version: '0'
98
158
  requirements: []
99
- rubyforge_project:
100
- rubygems_version: 2.7.6
159
+ rubygems_version: 3.0.3
101
160
  signing_key:
102
161
  specification_version: 4
103
162
  summary: AsciiMath parser and converter
104
163
  test_files:
164
+ - spec/ast.rb
165
+ - spec/customisation_spec.rb
105
166
  - spec/parser_spec.rb
167
+ - spec/schema/mathml2/common/common-attribs.xsd
168
+ - spec/schema/mathml2/common/math.xsd
169
+ - spec/schema/mathml2/common/xlink-href.xsd
170
+ - spec/schema/mathml2/content/arith.xsd
171
+ - spec/schema/mathml2/content/calculus.xsd
172
+ - spec/schema/mathml2/content/common-attrib.xsd
173
+ - spec/schema/mathml2/content/constants.xsd
174
+ - spec/schema/mathml2/content/constructs.xsd
175
+ - spec/schema/mathml2/content/elementary-functions.xsd
176
+ - spec/schema/mathml2/content/functions.xsd
177
+ - spec/schema/mathml2/content/linear-algebra.xsd
178
+ - spec/schema/mathml2/content/logic.xsd
179
+ - spec/schema/mathml2/content/relations.xsd
180
+ - spec/schema/mathml2/content/semantics.xsd
181
+ - spec/schema/mathml2/content/sets.xsd
182
+ - spec/schema/mathml2/content/statistics.xsd
183
+ - spec/schema/mathml2/content/tokens.xsd
184
+ - spec/schema/mathml2/content/vector-calculus.xsd
185
+ - spec/schema/mathml2/mathml2.xsd
186
+ - spec/schema/mathml2/presentation/action.xsd
187
+ - spec/schema/mathml2/presentation/characters.xsd
188
+ - spec/schema/mathml2/presentation/common-attribs.xsd
189
+ - spec/schema/mathml2/presentation/common-types.xsd
190
+ - spec/schema/mathml2/presentation/error.xsd
191
+ - spec/schema/mathml2/presentation/layout.xsd
192
+ - spec/schema/mathml2/presentation/scripts.xsd
193
+ - spec/schema/mathml2/presentation/space.xsd
194
+ - spec/schema/mathml2/presentation/style.xsd
195
+ - spec/schema/mathml2/presentation/table.xsd
196
+ - spec/schema/mathml2/presentation/tokens.xsd
197
+ - spec/schema/mathml3/mathml3-common.xsd
198
+ - spec/schema/mathml3/mathml3-content.xsd
199
+ - spec/schema/mathml3/mathml3-presentation.xsd
200
+ - spec/schema/mathml3/mathml3-strict-content.xsd
201
+ - spec/schema/mathml3/mathml3.xsd
@@ -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.8.7
9
- - 1.9.3
10
- - 2.0.0
11
- - 2.1.0
12
- - jruby-1.7.27
13
- # - jruby
14
- before_install:
15
- - gem update --system
16
- - gem install bundler
17
- install:
18
- - bundle install --path vendor/bundle --jobs=3 --retry=3