Skip to content

Commit

Permalink
Working in finish the README. Changed 'blindtex' module to 'tex2all' …
Browse files Browse the repository at this point in the history
…for better undestanding. Configure Setup to allow cli use of blindtex.
  • Loading branch information
aenriquerg committed Jul 25, 2018
1 parent 49e4623 commit f6b3226
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "2.7"
# - "2.7"
- "3.6"
before_install:
- pip install pytest pytest-cov
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
-----------
[![Build Status](https://travis-ci.org/blindtex/blindtex.svg?branch=master)](https://travis-ci.org/blindtex/blindtex) [![Coverage Status](https://coveralls.io/repos/github/blindtex/blindtex/badge.svg?branch=master)](https://coveralls.io/github/blindtex/blindtex?branch=master)

El objetivo del proyecto BlindTeX es mejorar la accesibilidad de los documentos matemáticos
escritos en (La)TeX , para esto se intenta mejorar la capacidad del documento de transmitir
la información matemática plasmada hacia el usuario por medio de pistas auditivas o textuales.

En construcción
BlindTeX cree la posibilidad de eliminar barreras que impiden el acceso al conocimiento científico, de manera que personas con discapacidad visual logren mayor autonomía a nivel personal, académico y laboral. Combinando los conocimientos en ciencias exactas y desarrollo de software,

## Modo de uso
```
blindtex --help
TODO
```

## Instalación
TODO
```
# For Develop and test purposes
pip3 install --editable .
```

Se puede probar el ejemplo de la siguiente manera
```
cd examples
python3 lineal_read.py -e '\frac{2}{3+4}''
fraction 2 over 3 + 4 endfraction
```

## Documentación
TODO
Expand All @@ -24,6 +30,7 @@ TODO
```
# run the tests
pytest
python3 -m pytest
```
##Licencia
TODO
12 changes: 12 additions & 0 deletions blindtex/blindtex.py → blindtex/tex2all.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
from blindtex.latex2ast import converter
from blindtex.interpreter import reader

Expand All @@ -13,3 +14,14 @@ def read_equation_list(latex_equation,mode='lineal'):
cv_s = converter.latex2list(latex_equation)
literal_lineal_eq = reader.literal_read_formula_list(cv_s)
return(literal_lineal_eq)

def main():
parser = argparse.ArgumentParser(description="Tool for LaTeX's equations convertion")

parser.add_argument('-e','--equation', dest='equation',
help = 'Latex format equation to convert',
default="")
args = parser.parse_args()

if args.equation:
print(read_equation(args.equation))
5 changes: 3 additions & 2 deletions examples/lineal_read.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python3
import argparse
from blindtex import blindtex
from blindtex import tex2all

def main():
parser = argparse.ArgumentParser(description="Tool for LaTeX's equations convertion")
Expand All @@ -10,7 +11,7 @@ def main():
args = parser.parse_args()

if args.equation:
print(blindtex.read_equation(args.equation))
print(tex2all.read_equation(args.equation))

if __name__=='__main__':
main()
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
),
#entry_points={
# 'console_scripts': [
# 'blindtex = blindtex.blindtex:main'
# ]
# }
entry_points={
'console_scripts': [
'blindtex = blindtex.tex2all:main'
]
}
)
12 changes: 6 additions & 6 deletions tests/test_blindtex.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import pytest
from blindtex import blindtex
from blindtex import tex2all

def test_read_equation_list():
equation = "1+2"
expected_reading = ['1','+','2']
reading = blindtex.read_equation_list(equation)
reading = tex2all.read_equation_list(equation)
assert expected_reading == reading

equation = "\\frac{1}{2}"
expected_reading = ['1','over','2']
reading = blindtex.read_equation_list(equation)
reading = tex2all.read_equation_list(equation)
assert expected_reading == reading

equation = "\\int_0^2 x^4 dx"
expected_reading = ['int', 'from', '0', 'to', '2', 'of', 'x', 'super', '4', 'd', 'x']
reading = blindtex.read_equation_list(equation)
reading = tex2all.read_equation_list(equation)
assert expected_reading == reading

equation = "\\sqrt[5]{x+b}"
expected_reading = ['root','5','of','x','+','b','endroot']
reading = blindtex.read_equation_list(equation)
reading = tex2all.read_equation_list(equation)
assert expected_reading == reading

equation = "\\sqrt{x+b}"
expected_reading = ['squarerootof','x','+','b','endroot']
reading = blindtex.read_equation_list(equation)
reading = tex2all.read_equation_list(equation)
assert expected_reading == reading

0 comments on commit f6b3226

Please sign in to comment.