Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/remove asciimath2unitsml #954

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion metanorma-standoc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading