few styling changes + now ignoring lines with colon at the end
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (push) Successful in -2s

This commit is contained in:
2025-09-25 21:43:14 +02:00
parent b03faed2fb
commit 8b4662c027
3 changed files with 37 additions and 20 deletions

View File

@@ -52,6 +52,8 @@ def convert_text(text: str, format_indents:bool=True):
return "\n".join(changed_lines).strip() return "\n".join(changed_lines).strip()
def match_and_replace(line:str, format_indents:bool=True) -> str: def match_and_replace(line:str, format_indents:bool=True) -> str:
if re.search(":$", line) != None:
return line
if format_indents: if format_indents:
line, num = re.subn("(\t+.)(..*)", rf"\1 {{{{c1::\2}}}}", line) line, num = re.subn("(\t+.)(..*)", rf"\1 {{{{c1::\2}}}}", line)
if num > 0: if num > 0:

View File

@@ -40,28 +40,44 @@ h1 {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
textarea { #left {
grid-area: input; grid-area: input;
} }
pre { #right {
grid-area: output; grid-area: output;
} }
main > div { #copy-btn {
align-self: flex-start;
}
main > div,
main > form {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 0.5rem;
} }
textarea { textarea {
width: 100%; width: 100%;
height: 20vh; height: 100%;
margin: 20px 0; margin: 20px 0;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
pre {
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
input[type="file"] { input[type="file"] {
display: none; display: none;
} }

View File

@@ -7,27 +7,26 @@
<body> <body>
<main> <main>
<h1 class="input">Upload File/Enter Text</h1> <h1 class="input">Upload File/Enter Text</h1>
<div id="left"> <form id="left" action="/upload" method="post" enctype="multipart/form-data" class="">
<form action="/upload" method="post" enctype="multipart/form-data" class=""> <div class="form_button">
<div class="form_button"> <label class="custom-file-upload">
<label class="custom-file-upload"> <input id="myfile" type="file" name="file" accept=".pdf" />
<input id="myfile" type="file" name="file" accept=".pdf" /> <span>Custom Upload</span>
<span>Custom Upload</span> </label>
</label> <button type="submit">Convert</button>
<button type="submit">Convert</button> <div class="checkbox-wrapper-14">
<div class="checkbox-wrapper-14"> <input id="s1-14" type="checkbox" class="switch" {% if format_indents %}checked {% endif %} name="format_indents" />
<input id="s1-14" type="checkbox" class="switch" {% if format_indents %}checked {% endif %} name="format_indents" /> <label for="s1-14">Stichpunkte formatieren</label>
<label for="s1-14">Stichpunkte formatieren</label>
</div>
</div> </div>
<br /> </div>
<textarea name="text">{% if resp_text %}{{ base_text }}{% else %}Text in here{% endif %}</textarea> <br />
</form> <textarea name="text">{% if resp_text %}{{ base_text }}{% else %}Text in here{% endif %}</textarea>
</div> </form>
{% if resp_text %} {% if resp_text %}
<h1 class="output">Converted Text</h1> <h1 class="output">Converted Text</h1>
<div id="right"> <div id="right">
<button id="copy-btn">Copy Text</button> <button id="copy-btn">Copy Text</button>
<br />
<pre id="myInput"> <pre id="myInput">
{{ resp_text }} {{ resp_text }}
</pre </pre