plurimath 0.4.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.rspec +3 -0
  4. data/.rspec-opal +11 -0
  5. data/Gemfile +3 -0
  6. data/Rakefile +11 -0
  7. data/lib/plurimath/asciimath/transform.rb +15 -0
  8. data/lib/plurimath/latex/constants.rb +3 -0
  9. data/lib/plurimath/latex/parse.rb +20 -11
  10. data/lib/plurimath/latex/transform.rb +24 -2
  11. data/lib/plurimath/math/core.rb +88 -0
  12. data/lib/plurimath/math/formula.rb +68 -24
  13. data/lib/plurimath/math/function/base.rb +8 -2
  14. data/lib/plurimath/math/function/binary_function.rb +36 -4
  15. data/lib/plurimath/math/function/color.rb +14 -0
  16. data/lib/plurimath/math/function/fenced.rb +27 -0
  17. data/lib/plurimath/math/function/floor.rb +1 -1
  18. data/lib/plurimath/math/function/font_style.rb +46 -0
  19. data/lib/plurimath/math/function/frac.rb +6 -0
  20. data/lib/plurimath/math/function/int.rb +7 -0
  21. data/lib/plurimath/math/function/left.rb +19 -1
  22. data/lib/plurimath/math/function/lim.rb +6 -0
  23. data/lib/plurimath/math/function/limits.rb +7 -0
  24. data/lib/plurimath/math/function/log.rb +6 -0
  25. data/lib/plurimath/math/function/menclose.rb +6 -0
  26. data/lib/plurimath/math/function/mod.rb +6 -0
  27. data/lib/plurimath/math/function/msgroup.rb +28 -0
  28. data/lib/plurimath/math/function/multiscript.rb +7 -0
  29. data/lib/plurimath/math/function/nary.rb +94 -0
  30. data/lib/plurimath/math/function/oint.rb +6 -0
  31. data/lib/plurimath/math/function/over.rb +6 -0
  32. data/lib/plurimath/math/function/overset.rb +6 -0
  33. data/lib/plurimath/math/function/power.rb +8 -2
  34. data/lib/plurimath/math/function/power_base.rb +10 -31
  35. data/lib/plurimath/math/function/prod.rb +19 -18
  36. data/lib/plurimath/math/function/right.rb +19 -1
  37. data/lib/plurimath/math/function/root.rb +6 -0
  38. data/lib/plurimath/math/function/rule.rb +7 -0
  39. data/lib/plurimath/math/function/semantics.rb +6 -0
  40. data/lib/plurimath/math/function/stackrel.rb +6 -0
  41. data/lib/plurimath/math/function/substack.rb +6 -0
  42. data/lib/plurimath/math/function/sum.rb +26 -25
  43. data/lib/plurimath/math/function/table.rb +52 -24
  44. data/lib/plurimath/math/function/td.rb +28 -0
  45. data/lib/plurimath/math/function/ternary_function.rb +44 -4
  46. data/lib/plurimath/math/function/text.rb +25 -3
  47. data/lib/plurimath/math/function/tr.rb +28 -0
  48. data/lib/plurimath/math/function/unary_function.rb +43 -3
  49. data/lib/plurimath/math/function/underover.rb +7 -55
  50. data/lib/plurimath/math/function/underset.rb +6 -0
  51. data/lib/plurimath/math/function/vec.rb +40 -0
  52. data/lib/plurimath/math/function.rb +7 -5
  53. data/lib/plurimath/math/number.rb +9 -5
  54. data/lib/plurimath/math/symbol.rb +13 -9
  55. data/lib/plurimath/math.rb +1 -3
  56. data/lib/plurimath/mathml/parser.rb +4 -4
  57. data/lib/plurimath/mathml/transform.rb +3 -4
  58. data/lib/plurimath/omml/parser.rb +19 -3
  59. data/lib/plurimath/omml/transform.rb +19 -14
  60. data/lib/plurimath/setup/oga.rb +5 -0
  61. data/lib/plurimath/setup/opal.rb.erb +8 -0
  62. data/lib/plurimath/setup/ox.rb +5 -0
  63. data/lib/plurimath/utility.rb +60 -34
  64. data/lib/plurimath/version.rb +1 -1
  65. data/lib/plurimath/xml_engine/oga.rb +246 -0
  66. data/lib/plurimath/xml_engine/ox.rb +29 -0
  67. data/lib/plurimath/xml_engine.rb +6 -0
  68. data/lib/plurimath.rb +12 -2
  69. metadata +11 -2
data/lib/plurimath.rb CHANGED
@@ -1,4 +1,14 @@
1
- # frozen_string_literal: true
2
1
 
3
2
  require_relative "plurimath/version"
4
- require_relative "plurimath/math"
3
+
4
+ # Select an XML engine
5
+ if RUBY_ENGINE == 'opal'
6
+ require "plurimath/setup/oga"
7
+ require "plurimath/setup/opal"
8
+ elsif ENV['PLURIMATH_OGA']
9
+ require "plurimath/setup/oga"
10
+ else
11
+ require "plurimath/setup/ox"
12
+ end
13
+
14
+ require "plurimath/math"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plurimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-01 00:00:00.000000000 Z
11
+ date: 2023-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -49,6 +49,8 @@ files:
49
49
  - ".github/workflows/release.yml"
50
50
  - ".gitignore"
51
51
  - ".hound.yml"
52
+ - ".rspec"
53
+ - ".rspec-opal"
52
54
  - ".rubocop.yml"
53
55
  - AsciiMath-Supported-Data.adoc
54
56
  - CODE_OF_CONDUCT.md
@@ -146,6 +148,7 @@ files:
146
148
  - lib/plurimath/math/function/msgroup.rb
147
149
  - lib/plurimath/math/function/msline.rb
148
150
  - lib/plurimath/math/function/multiscript.rb
151
+ - lib/plurimath/math/function/nary.rb
149
152
  - lib/plurimath/math/function/norm.rb
150
153
  - lib/plurimath/math/function/obrace.rb
151
154
  - lib/plurimath/math/function/oint.rb
@@ -202,10 +205,16 @@ files:
202
205
  - lib/plurimath/omml.rb
203
206
  - lib/plurimath/omml/parser.rb
204
207
  - lib/plurimath/omml/transform.rb
208
+ - lib/plurimath/setup/oga.rb
209
+ - lib/plurimath/setup/opal.rb.erb
210
+ - lib/plurimath/setup/ox.rb
205
211
  - lib/plurimath/unicode.rb
206
212
  - lib/plurimath/unitsml.rb
207
213
  - lib/plurimath/utility.rb
208
214
  - lib/plurimath/version.rb
215
+ - lib/plurimath/xml_engine.rb
216
+ - lib/plurimath/xml_engine/oga.rb
217
+ - lib/plurimath/xml_engine/ox.rb
209
218
  - plurimath.gemspec
210
219
  homepage: https://github.com/plurimath/plurimath
211
220
  licenses: