Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kernelboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from dotenv import load_dotenv
from flask import Flask
from flask_talisman import Talisman
import markdown
from . import color, db, env, error, health, index, leaderboard, news, score, time

def create_app(test_config=None):
Expand All @@ -27,7 +28,8 @@ def create_app(test_config=None):
app,
content_security_policy={
'default-src': "'self'",
'script-src': "'self' https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
'script-src': "'self' https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js",
'style-src': "'self' 'unsafe-inline'"
},
force_https=app.config.get('TALISMAN_FORCE_HTTPS', True))

Expand All @@ -44,6 +46,7 @@ def create_app(test_config=None):
app.add_template_filter(score.format_score, 'format_score')
app.add_template_filter(time.to_time_left, 'to_time_left')
app.add_template_filter(time.format_datetime, 'format_datetime')
app.add_template_filter(lambda text: markdown.markdown(text, extensions=['fenced_code', 'tables', 'nl2br']), 'markdown')

app.register_blueprint(health.blueprint)
app.add_url_rule('/health', endpoint='health')
Expand Down
2 changes: 1 addition & 1 deletion kernelboard/templates/leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2>GPU Type{{ 's' if gpu_types|length > 1 or gpu_types|length == 0}}</h2>
<div>
<div class="leaderboard-card">
<h2>Description</h2>
<p class="whitespace-pre-wrap leading-relaxed">{{ description }}</p>
<div class="prose max-w-none">{{ description|markdown|safe }}</div>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.0.0"
description = "Kernelboard is a webapp for GPU MODE."
dependencies = [
"flask",
"markdown",
]

[build-system]
Expand Down