Update to v1.1.1: Add Unix terminal dark-mode theme and enforce original language retention.

This commit is contained in:
Johannes Reichhardt 2026-04-01 00:19:36 -05:00
parent 2e89c7c6e9
commit 1bdbe7398b
3 changed files with 87 additions and 58 deletions

5
app.py
View File

@ -11,7 +11,7 @@ app = Flask(__name__)
app.secret_key = os.environ.get("FLASK_SECRET_KEY", "prod-secret-7721") app.secret_key = os.environ.get("FLASK_SECRET_KEY", "prod-secret-7721")
metrics = PrometheusMetrics(app) metrics = PrometheusMetrics(app)
metrics.info('app_info', 'Application info', version='1.1.0') metrics.info('app_info', 'Application info', version='1.1.1')
# API Configuration # API Configuration
api_key = os.environ.get("AI_API_KEY") api_key = os.environ.get("AI_API_KEY")
@ -24,6 +24,8 @@ if api_key:
"Additionally, you insert relevant and tasteful emojis as Markdown " "Additionally, you insert relevant and tasteful emojis as Markdown "
"shortcodes (e.g., :rocket:, :bulb:, :memo:) at the beginning of section " "shortcodes (e.g., :rocket:, :bulb:, :memo:) at the beginning of section "
"headings to represent the topic. " "headings to represent the topic. "
"CRITICAL: Always maintain the original language of the input text. "
"Do NOT translate the content."
) )
model = genai.GenerativeModel( model = genai.GenerativeModel(
model_name='gemini-2.5-flash', model_name='gemini-2.5-flash',
@ -52,6 +54,7 @@ def index():
# Content processing logic # Content processing logic
prompt = ( prompt = (
f"Convert the following text into high-quality standard Markdown. " f"Convert the following text into high-quality standard Markdown. "
f"Maintain the original language of the text. Do NOT translate it. "
f"Use ATX headings (#), standard formatting, and include relevant " f"Use ATX headings (#), standard formatting, and include relevant "
f"emoji shortcodes (like :smile:) for each section heading to make " f"emoji shortcodes (like :smile:) for each section heading to make "
f"the document more engaging. Return ONLY the markdown content:\n\n" f"the document more engaging. Return ONLY the markdown content:\n\n"

View File

@ -70,7 +70,7 @@ spec:
serviceAccountName: txt2md-sa serviceAccountName: txt2md-sa
containers: containers:
- name: txt2md - name: txt2md
image: europe-west3-docker.pkg.dev/project-84ddd43d-e408-4cb9-8cb/txt2md-repo/txt2md:v1.1.0 image: europe-west3-docker.pkg.dev/project-84ddd43d-e408-4cb9-8cb/txt2md-repo/txt2md:v1.1.1
ports: ports:
- containerPort: 5000 - containerPort: 5000
env: env:

View File

@ -1,16 +1,18 @@
:root { :root {
--primary-color: #3498db; --primary-color: #00ff00; /* Terminal Green */
--secondary-color: #2c3e50; --secondary-color: #33ff33;
--background-color: #f8f9fa; --background-color: #121212;
--text-color: #333; --surface-color: #1e1e1e;
--border-color: #ddd; --text-color: #e0e0e0;
--alert-error: #e74c3c; --border-color: #333;
--alert-warning: #f39c12; --alert-error: #ff5555;
--alert-info: #3498db; --alert-warning: #ffb86c;
--alert-info: #8be9fd;
--font-mono: "Fira Code", "Courier New", Courier, monospace;
} }
body { body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-family: var(--font-mono);
background-color: var(--background-color); background-color: var(--background-color);
color: var(--text-color); color: var(--text-color);
line-height: 1.6; line-height: 1.6;
@ -19,25 +21,31 @@ body {
} }
.container { .container {
max-width: 1200px; max-width: 1400px;
margin: 2rem auto; margin: 2rem auto;
padding: 0 1.5rem; padding: 0 1.5rem;
} }
header { header {
text-align: center; text-align: left;
margin-bottom: 3rem; margin-bottom: 3rem;
border-bottom: 1px solid var(--border-color);
padding-bottom: 1rem;
} }
header h1 { header h1 {
font-size: 2.5rem; font-size: 2rem;
color: var(--secondary-color); color: var(--primary-color);
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
header h1::before {
content: "> ";
}
header p { header p {
color: #666; color: #888;
font-size: 1.1rem; font-size: 1rem;
} }
.editor-grid { .editor-grid {
@ -47,29 +55,43 @@ header p {
} }
section h2 { section h2 {
font-size: 1.25rem; font-size: 1.1rem;
margin-bottom: 1rem; margin-bottom: 1rem;
color: var(--secondary-color); color: var(--primary-color);
border-bottom: 2px solid var(--primary-color); text-transform: uppercase;
padding-bottom: 0.5rem; letter-spacing: 1px;
}
section h2::before {
content: "[ ";
}
section h2::after {
content: " ]";
} }
textarea { textarea {
width: 100%; width: 100%;
height: 400px; height: 450px;
padding: 1rem; padding: 1rem;
background-color: var(--surface-color);
color: var(--primary-color);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 8px; border-radius: 4px;
font-size: 1rem; font-size: 1rem;
font-family: inherit; font-family: var(--font-mono);
resize: vertical; resize: vertical;
box-shadow: 0 2px 4px rgba(0,0,0,0.05); box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
} }
textarea:focus { textarea:focus {
outline: none; outline: none;
border-color: var(--primary-color); border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); }
.markdown-output {
background-color: #000;
color: #f0f0f0;
margin-bottom: 2rem;
} }
button { button {
@ -79,35 +101,37 @@ button {
width: 100%; width: 100%;
padding: 0.75rem; padding: 0.75rem;
margin-top: 1rem; margin-top: 1rem;
background-color: var(--primary-color); background-color: transparent;
color: white; color: var(--primary-color);
border: none; border: 1px solid var(--primary-color);
border-radius: 8px; border-radius: 4px;
font-size: 1rem; font-size: 1rem;
font-weight: 600; font-weight: 600;
font-family: var(--font-mono);
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.2s ease;
} }
button:hover:not(:disabled) { button:hover:not(:disabled) {
background-color: #2980b9; background-color: rgba(0, 255, 0, 0.1);
box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
} }
button:disabled { button:disabled {
background-color: #a5ccea; border-color: #444;
color: #444;
cursor: not-allowed; cursor: not-allowed;
opacity: 0.8;
} }
.spinner { .spinner {
display: none; display: none;
width: 20px; width: 18px;
height: 20px; height: 18px;
border: 3px solid rgba(255, 255, 255, 0.3); border: 2px solid rgba(0, 255, 0, 0.2);
border-radius: 50%; border-radius: 50%;
border-top-color: #fff; border-top-color: var(--primary-color);
animation: spin 1s ease-in-out infinite; animation: spin 0.8s linear infinite;
margin-right: 10px; margin-right: 12px;
} }
@keyframes spin { @keyframes spin {
@ -119,17 +143,17 @@ button.loading .spinner {
} }
.preview { .preview {
background-color: white; background-color: var(--surface-color);
padding: 1rem; padding: 1.5rem;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 8px; border-radius: 4px;
height: 400px; height: 450px;
overflow-y: auto; overflow-y: auto;
box-shadow: 0 2px 4px rgba(0,0,0,0.05); color: #ccc;
} }
.preview .placeholder { .preview .placeholder {
color: #999; color: #555;
font-style: italic; font-style: italic;
text-align: center; text-align: center;
margin-top: 2rem; margin-top: 2rem;
@ -141,23 +165,25 @@ button.loading .spinner {
.alert { .alert {
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
border-radius: 6px; border-radius: 4px;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
font-weight: 500; font-family: var(--font-mono);
font-size: 0.9rem;
} }
.alert.error { background-color: #fadbd8; color: var(--alert-error); border: 1px solid #f5b7b1; } .alert.error { background-color: rgba(255, 85, 85, 0.1); color: var(--alert-error); border: 1px solid var(--alert-error); }
.alert.warning { background-color: #fef5e7; color: var(--alert-warning); border: 1px solid #f9e79f; } .alert.warning { background-color: rgba(255, 184, 108, 0.1); color: var(--alert-warning); border: 1px solid var(--alert-warning); }
.alert.info { background-color: #ebf5fb; color: var(--alert-info); border: 1px solid #d6eaf8; } .alert.info { background-color: rgba(139, 233, 253, 0.1); color: var(--alert-info); border: 1px solid var(--alert-info); }
/* Markdown Preview Styles */ /* Markdown Preview Styles */
.preview h1 { font-size: 1.5rem; margin-top: 0; } .preview h1, .preview h2, .preview h3 { color: var(--primary-color); border-bottom: none; padding-bottom: 0; }
.preview h2 { font-size: 1.3rem; } .preview h1 { font-size: 1.4rem; }
.preview blockquote { border-left: 4px solid #eee; padding-left: 1rem; color: #666; margin-left: 0; } .preview h2 { font-size: 1.2rem; }
.preview pre { background-color: #f4f4f4; padding: 1rem; border-radius: 4px; overflow-x: auto; } .preview blockquote { border-left: 2px solid var(--primary-color); padding-left: 1rem; color: #888; font-style: italic; margin-left: 0; }
.preview code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; background-color: #f4f4f4; padding: 0.2rem 0.4rem; border-radius: 3px; } .preview pre { background-color: #000; padding: 1rem; border-radius: 4px; border: 1px solid #333; overflow-x: auto; }
.preview code { font-family: var(--font-mono); background-color: #222; padding: 0.2rem 0.4rem; border-radius: 3px; color: #ff79c6; }
@media (max-width: 768px) { @media (max-width: 992px) {
.editor-grid { .editor-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }