chore: cleaning

This commit is contained in:
Krzysztof Rudnicki 2023-05-31 03:53:16 +02:00
parent 515d8ff320
commit ceed76f6ed
26 changed files with 53 additions and 33 deletions

9
program/README.md Normal file
View File

@ -0,0 +1,9 @@
To run unit tests:
Enter project environment:
source /ecote/bin/activate
Run tests:
python -m pytest unit_tests

View File

@ -0,0 +1,15 @@
\documentclass{article}
\begin{document}
some random text
\begin{tabular}{c}
inside table
\end{tabular}
some random text 2
\begin{tabular}{c}
inside table2
\end{tabular}
\begin{tabular}{c}
inside table3
\end{tabular}
\end{document}

View File

@ -0,0 +1 @@
<!DOCTYPE html><html>some random text<html> <table><tr><td align='center'> inside table</td></tr> </table> </html>some random text 2<html> <table><tr><td align='center'> inside table2</td></tr> </table> </html><html> <table><tr><td align='center'> inside table3</td></tr> </table> </html>

View File

@ -0,0 +1,7 @@
\documentclass{class}
\begin{document}
\begin{tabular}{ l c r }
1 & 2 & 3 \\
4 & 5 6 \\
\end{tabular}
\end{document}

View File

@ -0,0 +1 @@
<!DOCTYPE html><html>Error!

View File

@ -0,0 +1,9 @@
\documentclass{class}
\begin{document}
\begin{tabular}{ l | c | r }
test & 2 & test \\
4 & 5 & 6 \\
\end{tabular}
\end{document}
\end{lstlisting}&
\begin{lstlisting}

View File

@ -0,0 +1 @@
<!DOCTYPE html><html><html> <table><tr><td align='left'>test </td><td style='border-left: 1px solid black'align='center'> 2 </td><td style='border-left: 1px solid black'align='right'> test </td></tr><tr><td align='left'></td></tr><tr><td align='left'>4 </td><td style='border-left: 1px solid black'align='center'> 5 </td><td style='border-left: 1px solid black'align='right'> 6 </td></tr><tr><td align='left'></td></tr><tr><td align='left'></td></tr> </table> </html>

View File

@ -1,30 +0,0 @@
"""
Holds an array of all classes from https://ctan.org/topic/class
"""
classes = [
"article",
"report",
"book",
"beamer",
"letter",
"memoir",
"slides",
"IEEEtran",
"exam",
"amsart",
"amsbook",
"tufte-book",
"scrartcl",
"scrreprt",
"moderncv",
"cv",
"res",
"elsarticle",
"acm_proc_article-sp",
"scrbook",
]
def return_latex_classes():
"""Returns latex classes array"""
return classes

View File

@ -217,6 +217,10 @@ def translate_inside_to_html(latex_table_inside, column_style):
column_number = 0
for column in columns:
return_string += "<td "
if column_number >= len(column_style):
print(
f"Error! column_number index: {column_number} is out of length of column_style: {column_style}")
return "Error!"
current_style = column_style[column_number]
while current_style == line_string:
return_string += line_string
@ -315,8 +319,7 @@ def handle_insides(html_string, data):
return html_string, data
def main_function():
tex_filename = "texfile.tex"
def main_function(tex_filename):
data = read_file(tex_filename)
html_string = ""
html_string, data = read_start(html_string, data)
@ -329,4 +332,7 @@ def main_function():
if __name__ == "__main__":
print(main_function())
tex_filename = "texfile.tex"
final_html = main_function(tex_filename)
f = open(tex_filename + ".html", "w")
f.write(final_html)

Binary file not shown.

View File

@ -0,0 +1 @@
<!DOCTYPE html><html>some random text<html> <table><tr><td align='center'> inside table</td></tr> </table> </html>some random text 2<html> <table><tr><td align='center'> inside table2</td></tr> </table> </html><html> <table><tr><td align='center'> inside table3</td></tr> </table> </html>