Skip to content

Commit

Permalink
Add version 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
belerico committed Apr 16, 2020
1 parent b30823a commit 20f0b25
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion py_asciimath/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
__version__ = "0.2.3"
__version__ = "0.2.4"
2 changes: 2 additions & 0 deletions py_asciimath/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ def parse(
Args:
xml (str): String representing a MathML XML.
dtd (str): MathML DTD type. Must be on of the following:
`mathml1`, `mathml2` or `mathml3`
dtd_validation (bool, optional): Validate XML against DTD during
parsing. Defaults to True.
network (bool, optional): Validate against remote DTD.
Expand Down
4 changes: 2 additions & 2 deletions py_asciimath/py_asciimath.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def main():
ilang = (
arguments["<ILANG>"].lower()
if arguments["from"]
else arguments["--input"]
else arguments["--input"].lower()
)
olang = (
arguments["<OLANG>"].lower()
if arguments["to"]
else arguments["--output"]
else arguments["--output"].lower()
)
if ilang == olang:
print("Same input and output language. Nothing to do")
Expand Down
26 changes: 13 additions & 13 deletions py_asciimath/translator/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def translate(self, exp, from_file=False, to_file=None, **kwargs):
"""Translates an input expression s
Args:
exp (str): String to translate. If from_file is `True`, then s
exp (str): String to translate. If from_file is True, then s
must represent the file's path
from_file (bool, optional): If `True`, load the string to translate
from_file (bool, optional): If True, load the string to translate
from the file specified by s. Defaults to False.
to_file (str, optional): If specified, save the translation to
`to_file`. Defaults to None.
Expand Down Expand Up @@ -116,9 +116,9 @@ def translate(
specified by `self.transformer`
Args:
exp (str): String to translate. If from_file is `True`, then s
exp (str): String to translate. If from_file is True, then s
must represent the file's path
from_file (bool, optional): If `True`, load the string to translate
from_file (bool, optional): If True, load the string to translate
from the file specified by s. Defaults to False.
to_file (str, optional): If specified, save the translation to
`to_file`. Defaults to None.
Expand Down Expand Up @@ -178,11 +178,11 @@ def translate(
"""Translates an ASCIIMath string to LaTeX
Args:
exp (str): String to translate. If from_file is `True`, then s
exp (str): String to translate. If from_file is True, then s
must represent the file's path
displaystyle (bool, optional): Add displaystyle attribute.
Defaults to False.
from_file (bool, optional): If `True`, load the string to translate
from_file (bool, optional): If True, load the string to translate
from the file specified by s. Defaults to False.
pprint (bool, optional): Abstract Syntax Tree pretty print.
Defaults to False.
Expand Down Expand Up @@ -295,19 +295,19 @@ def translate(
"""Translates an ASCIIMath string to MathML
Args:
exp (str): String to translate. If from_file is `True`, then s
exp (str): String to translate. If from_file is True, then s
must represent the file's path
displaystyle (bool, optional): Add displaystyle attribute.
Defaults to False.
dtd (str, optional): MathML DTD version to validate the output
against. It can be: `mathml1`, `mathml2` or `mathml3`.
Defaults to None.
dtd_validation (bool, optional): If `True` validate output against
dtd_validation (bool, optional): If True validate output against
the DTD version specified by `dtd`.
Defaults to False.
from_file (bool, optional): If `True`, load the string to translate
from_file (bool, optional): If True, load the string to translate
from the file specified by s. Defaults to False.
network (bool, optional): If `True` validate the output against
network (bool, optional): If True validate the output against
a remote DTD.
Defaults to False.
output (str, optional): Output mode: `string` to return the string
Expand Down Expand Up @@ -382,11 +382,11 @@ def translate(
"""Translates a MathML string to LaTeX
Args:
exp (str): String to translate. If from_file is `True`, then s
exp (str): String to translate. If from_file is True, then s
must represent the file's path
from_file (bool, optional): If `True`, load the string to translate
from_file (bool, optional): If True, load the string to translate
from the file specified by s. Defaults to False.
network (bool, optional): If `True` validate the output against
network (bool, optional): If True validate the output against
a remote DTD.
Defaults to False.
to_file (str, optional): If specified, save the translation to
Expand Down
2 changes: 1 addition & 1 deletion py_asciimath/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def check_mat(cls, s):
s (str): Input string to be matrix-checked
Returns:
bool, list: `True`, [left_par, right_par] if the string s
bool, list: True, [left_par, right_par] if the string s
has a matrix-like structure; False, [] otherwise
"""

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
install_requires=["lark-parser", "docopt", "lxml"],
)

0 comments on commit 20f0b25

Please sign in to comment.