Skip to content

Commit

Permalink
remove AsciiMath2UnitsML dependency: #947
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 24, 2024
1 parent 6bbc6ba commit 8921777
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
5 changes: 2 additions & 3 deletions lib/metanorma/standoc/cleanup_maths.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "asciimath2unitsml"
require_relative "cleanup_mathvariant"

module Metanorma
Expand Down Expand Up @@ -180,11 +179,11 @@ def mathml_number_format(stem)
end

def mathml_cleanup(xmldoc)
a2u = Asciimath2UnitsML::Conv.new(asciimath2unitsml_options)
#a2u = Asciimath2UnitsML::Conv.new(asciimath2unitsml_options)
xmldoc.xpath("//stem[@type = 'MathML'][not(@validate = 'false')]")
.each do |x|
mathml_xml_cleanup(x)
a2u.MathML2UnitsML(x)
#a2u.MathML2UnitsML(x)
mathml_mathvariant(x)
end
xmldoc.xpath("//stem[@type = 'MathML']")
Expand Down
4 changes: 3 additions & 1 deletion lib/metanorma/standoc/validate_term.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "iev"

module Metanorma
module Standoc
module Validate
Expand All @@ -7,7 +9,7 @@ module Validate
def init_iev
@no_isobib and return nil
@iev and return @iev
@iev = Iev::Db.new(@iev_globalname, @iev_localname) unless @no_isobib
@iev = ::IEV::Db.new(@iev_globalname, @iev_localname) unless @no_isobib
@iev
end

Expand Down
4 changes: 2 additions & 2 deletions metanorma-standoc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "addressable", "~> 2.8.0"
spec.add_dependency "asciidoctor", "~> 2.0.0"
spec.add_dependency "crass", "~> 1.0.0"
spec.add_dependency "iev", "~> 0.3.0"
spec.add_dependency "iev", ">= 0.3.4"
spec.add_dependency "isodoc", "~> 2.12.4"
spec.add_dependency "metanorma", ">= 1.6.0"
spec.add_dependency "metanorma-plugin-datastruct", "~> 0.3.0"
Expand All @@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "metanorma-utils", "~> 1.10.0"
spec.add_dependency "ruby-jing"
# relaton-cli not just relaton, to avoid circular reference in metanorma
spec.add_dependency "asciimath2unitsml", "~> 0.4.0"
#spec.add_dependency "asciimath2unitsml", "~> 0.4.0"
spec.add_dependency "concurrent-ruby"
spec.add_dependency "pngcheck"
spec.add_dependency "relaton-cli", "~> 1.20.0"
Expand Down
13 changes: 1 addition & 12 deletions spec/metanorma/cleanup_math_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,7 @@
stem:[1 "unitsml(cd)"]
[stem]
++++
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
<mn>7</mn>
<mtext>unitsml(m*kg^-2)</mtext>
<mo>+</mo>
<mn>8</mn>
<mtext>unitsml(m*kg^-3)</mtext>
</mrow>
</math>
++++
stem:[7 "unitsml(m*kg^-2)" + 8 "unitsml(m*kg^-3)"]
INPUT
output = <<~OUTPUT
#{BLANK_HDR.sub('<metanorma-extension>', <<~EXT
Expand Down

0 comments on commit 8921777

Please sign in to comment.