added build actions

This commit is contained in:
2025-08-29 09:44:55 +02:00
parent b70f0200db
commit e0b544da51
3 changed files with 83 additions and 33 deletions

View File

@@ -50,10 +50,10 @@ def convert_text(text: str):
for line in seperate(text):
# add anki field into line and count the number of changes
line, num = re.subn("(:)(..+)", rf"\1 {{{{c{field_nr}::\2}}}}", line)
line, num = re.subn("(:|\.)(..+)", rf"\1 {{{{c{field_nr}::\2}}}}", line)
# if anki field added increase field number
if num > 0:
field_nr += 1
# if num > 0:
# field_nr += 1
# add changed line to array
changed_lines.append(line)

View File

@@ -1,32 +1,34 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>Anki Converter</title>
<link rel="stylesheet" href='/static/style.css' />
</head>
<body>
<main>
<div id="left">
<h1>Upload File/Enter Text</h1>
<form action="/upload" method="post" enctype="multipart/form-data">
<label class="custom-file-upload">
<input id="myfile" type="file" name="file" accept=".pdf"/>
<span>Custom Upload</span>
</label>
<button type="submit">Upload</button>
<br>
<textarea name="text">{% if resp_text %}{{ base_text }}{% else %}Text in here{% endif %}</textarea>
</form>
</div>
{% if resp_text %}
<div id="right">
<h1>Converted Text</h1>
<button id="copy-btn">Copy Text</button>
<pre id="myInput">{{ resp_text }}
</pre>
</div>
{% endif %}
</main>
<script src="{{url_for('static', filename='script.js')}}"></script>
</body>
<head>
<title>Anki Converter</title>
<link rel="stylesheet" href="/static/style.css" />
</head>
<body>
<main>
<div id="left">
<h1>Upload File/Enter Text</h1>
<form action="/upload" method="post" enctype="multipart/form-data">
<label class="custom-file-upload">
<input id="myfile" type="file" name="file" accept=".pdf" />
<span>Custom Upload</span>
</label>
<button type="submit">Convert</button>
<br />
<textarea name="text">{% if resp_text %}{{ base_text }}{% else %}Text in here{% endif %}</textarea>
</form>
</div>
{% if resp_text %}
<div id="right">
<h1>Converted Text</h1>
<button id="copy-btn">Copy Text</button>
<pre id="myInput">
{{ resp_text }}
</pre
>
</div>
{% endif %}
</main>
<script src="{{url_for('static', filename='script.js')}}"></script>
</body>
</html>