Skip to content

Commit

Permalink
mathml2asciimath
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Apr 18, 2018
1 parent b600cd5 commit 35a73bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ document, and it may not cope with ordered lists or headings with customised app
For best results, reset the styles in the document you're converting to those in
the default Normal.dot template.

If you wish to convert the MathML in the document to AsciiMath, run the script with the
`--mathml2asciimath` option:

[source,console]
----
$ bundle exec bin/w2a --mathml2asciimath document.docx > document.adoc
----

=== Configuration

The following options are available:
Expand Down
7 changes: 4 additions & 3 deletions bin/w2a
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ def scrub_whitespace(string)
string
end

if ARGV.size != 1 && ARGV[1] != "--mathml2asciimath" || ARGV[0] == '--help'
if ARGV.size != 1 && ARGV[0] != "--mathml2asciimath" || ARGV[0] == '--help'
puts 'Usage: bundle exec w2m path/to/document.docx'
exit 1
end

if ARGV[1] == "--mathml2asciimath"
ReverseMarkdown.config.mathml2asciimath = true
if ARGV[0] == "--mathml2asciimath" && ARGV[1]
ReverseAsciidoctor.config.mathml2asciimath = true
ARGV[0] = ARGV[1]
end

if ARGV[0] == '--version'
Expand Down
1 change: 1 addition & 0 deletions lib/reverse_asciidoctor/cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def remove_inner_whitespaces(string)
line.strip.gsub(/[ \t]{2,}/, ' ')
end
end
string.gsub!(/\n stem:\[/, "\nstem:[")
end

# Find non-asterisk content that is enclosed by two or
Expand Down

0 comments on commit 35a73bc

Please sign in to comment.