IEEE.org
|
IEEE Xplore Digital Library
|
IEEE Standards
|
IEEE Spectrum
|
More Sites
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Open at RIT
Accessibility
tex2html
Commits
192efc9d
Commit
192efc9d
authored
Jun 23, 2021
by
Suhas CV
Browse files
upload instructions
parent
90a9d314
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
192efc9d
...
...
@@ -16,17 +16,20 @@ def hello_world():
@
app
.
route
(
"/convert/"
,
methods
=
[
"POST"
,
"GET"
])
def
convert
():
if
request
.
method
==
"POST"
:
uploaded_file
=
request
.
files
[
"latexFile"
]
input_file
=
str
(
uuid
.
uuid1
())
+
".zip"
uploaded_file
.
save
(
input_file
)
k
=
extractAndConvert
(
input_file
)
zip_io
=
io
.
BytesIO
(
open
(
"static/"
+
k
+
".zip"
,
'rb'
).
read
())
#zip_data =zipfile.ZipFile(zip_io,'r')
os
.
remove
(
"static/"
+
k
+
".zip"
)
return
send_file
(
zip_io
,
mimetype
=
"application/zip"
)
else
:
return
redirect
(
url_for
(
'hello_world'
))
try
:
if
request
.
method
==
"POST"
:
uploaded_file
=
request
.
files
[
"latexFile"
]
input_file
=
str
(
uuid
.
uuid1
())
+
".zip"
uploaded_file
.
save
(
input_file
)
k
=
extractAndConvert
(
input_file
)
zip_io
=
io
.
BytesIO
(
open
(
"static/"
+
k
+
".zip"
,
'rb'
).
read
())
#zip_data =zipfile.ZipFile(zip_io,'r')
os
.
remove
(
"static/"
+
k
+
".zip"
)
return
send_file
(
zip_io
,
mimetype
=
"application/zip"
)
else
:
return
redirect
(
url_for
(
'hello_world'
))
except
:
return
redirect
(
"/"
)
...
...
templates/index.html
View file @
192efc9d
...
...
@@ -2,7 +2,12 @@
{% block content %}
<div
>
<h1>
Convert Latex to Accessible HTML
</h1>
<p>
Make sure your latex
</p>
<p>
Make sure you follow the below instructions before uploading
</p>
<ol>
<li>
The name of your primary tex file in the project should be "main.tex"
</li>
<li>
If you would like to add banner to your project(optional step), include the banner image in your project and name it as "headerImage.png"
</li>
<li>
Compress your project into a zip file
</li>
</ol>
<form
action=
"{{ url_for('convert') }}"
method=
"post"
enctype=
"multipart/form-data"
>
<label
for=
"upload-latex"
>
upload
</label>
<input
id=
"upload-latex"
name=
"latexFile"
type=
"file"
accept=
".zip,.rar,.7zip"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment