Bump to v1.1.0: Add pymdownx.emoji support for rendering emoji shortcodes in the preview.
This commit is contained in:
parent
b7ae9a6484
commit
2e89c7c6e9
11
app.py
11
app.py
|
|
@ -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.0.9')
|
metrics.info('app_info', 'Application info', version='1.1.0')
|
||||||
|
|
||||||
# API Configuration
|
# API Configuration
|
||||||
api_key = os.environ.get("AI_API_KEY")
|
api_key = os.environ.get("AI_API_KEY")
|
||||||
|
|
@ -59,7 +59,14 @@ def index():
|
||||||
)
|
)
|
||||||
response = model.generate_content(prompt)
|
response = model.generate_content(prompt)
|
||||||
markdown_content = response.text
|
markdown_content = response.text
|
||||||
converted_html = markdown(markdown_content, extensions=['extra', 'codehilite'])
|
|
||||||
|
# Render HTML with emoji support
|
||||||
|
extensions = [
|
||||||
|
'extra',
|
||||||
|
'codehilite',
|
||||||
|
'pymdownx.emoji'
|
||||||
|
]
|
||||||
|
converted_html = markdown(markdown_content, extensions=extensions)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
flash(f"Error during processing: {str(e)}", "error")
|
flash(f"Error during processing: {str(e)}", "error")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.0.9
|
image: europe-west3-docker.pkg.dev/project-84ddd43d-e408-4cb9-8cb/txt2md-repo/txt2md:v1.1.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5000
|
- containerPort: 5000
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,4 @@ google-generativeai
|
||||||
python-dotenv
|
python-dotenv
|
||||||
markdown
|
markdown
|
||||||
prometheus-flask-exporter
|
prometheus-flask-exporter
|
||||||
|
pymdown-extensions
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue