Migrate mistune to markdown
This commit is contained in:
parent
412945626b
commit
77aaae6735
46 changed files with 5112 additions and 420 deletions
|
@ -57,6 +57,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="{{ static('libs/clipboard/tooltip.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ static('libs/select2/select2.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ static('icofont/icofont.min.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ static('markdown.css') }}">
|
||||
{% endcompress %}
|
||||
<link rel="canonical"
|
||||
href="{{ DMOJ_SCHEME }}://{{ DMOJ_CANONICAL|default(site.domain) }}{{ request.get_full_path() }}">
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
<div class="body content-description">
|
||||
{% cache 86400 'post_content' post.id MATH_ENGINE %}
|
||||
{{ post.content|markdown('blog', MATH_ENGINE)|reference|str|safe}}
|
||||
{{ post.content|markdown|reference|str|safe}}
|
||||
{% endcache %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</h2>
|
||||
<div class="summary content-description blog-description">
|
||||
{% cache 86400 'post_summary' post.id %}
|
||||
{{ post.summary|default(post.content, true)|markdown('blog', 'svg', lazy_load=True)|reference|str|safe }}
|
||||
{{ post.summary|default(post.content, true)|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
</div>
|
||||
</section>
|
|
@ -1 +1 @@
|
|||
{{ preview_data|markdown('blog', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
|
@ -66,7 +66,6 @@ let META_HEADER = [
|
|||
}
|
||||
|
||||
$('.body-block').slice(0, window.messages_per_page).each(function() {
|
||||
resize_emoji($(this));
|
||||
});
|
||||
|
||||
register_time($('.time-with-rel'));
|
||||
|
@ -153,7 +152,6 @@ let META_HEADER = [
|
|||
|
||||
function add_message(data) {
|
||||
var $data = $(data);
|
||||
resize_emoji($data.find('.body-block'));
|
||||
|
||||
$('#chat-log').append($data);
|
||||
$('#chat-box').scrollTop($('#chat-box')[0].scrollHeight);
|
||||
|
@ -212,7 +210,6 @@ let META_HEADER = [
|
|||
else {
|
||||
add_new_message(message, room, true);
|
||||
}
|
||||
resize_emoji($body_block);
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
||||
register_time($('.time-with-rel'));
|
||||
remove_unread_current_user();
|
||||
|
@ -439,10 +436,6 @@ let META_HEADER = [
|
|||
});
|
||||
{% endif %}
|
||||
|
||||
$('.body-block').each(function() {
|
||||
resize_emoji($(this));
|
||||
});
|
||||
|
||||
$("#chat-log").show();
|
||||
$("#chat-log").change(function() {
|
||||
$('#chat-log').scrollTop($('#chat-log')[0].scrollHeight);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
<div class="message-text message-text-other">
|
||||
{{message.body | markdown('comment', MATH_ENGINE, hard_wrap=True)|reference|str|safe }}
|
||||
{{message.body|markdown(hard_wrap=True)|reference|str|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
|
|
@ -1 +1 @@
|
|||
{{ comment.body|markdown('comment', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ comment.body|markdown|reference|str|safe }}
|
|
@ -13,6 +13,6 @@
|
|||
{% endif %}
|
||||
{% endwith %}
|
||||
<div class='blog-description content-description'>
|
||||
{{ comment.body |markdown("comment", MATH_ENGINE)|reference|str|safe }}
|
||||
{{ comment.body |markdown|reference|str|safe }}
|
||||
</div>
|
||||
</div>
|
|
@ -93,7 +93,7 @@
|
|||
</div>
|
||||
<div class="content content-description">
|
||||
<div class="comment-body"{% if node.score <= vote_hide_threshold %} style="display:none"{% endif %}>
|
||||
{{ node.body|markdown('comment', MATH_ENGINE, True)|reference|str|safe }}
|
||||
{{ node.body|markdown|reference|str|safe }}
|
||||
</div>
|
||||
{% if node.score <= vote_hide_threshold %}
|
||||
<div class="comment-body bad-comment-body">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('comment', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -1,3 +1,3 @@
|
|||
{% with node=revision.field_dict %}
|
||||
<div class="comment-body">{{ node.body|markdown('comment', MATH_ENGINE)|reference|str|safe }}</div>
|
||||
<div class="comment-body">{{ node.body|markdown|reference|str|safe }}</div>
|
||||
{% endwith %}
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
|
||||
<div class="content-description">
|
||||
{% cache 3600 'contest_html' contest.id MATH_ENGINE %}
|
||||
{{ contest.description|markdown('contest', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ contest.description|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('contest', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -4,4 +4,4 @@
|
|||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{{ tag.description|markdown('contest_tag') }}
|
||||
{{ tag.description|markdown }}
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
{% block header %}{% include "flatpages/admin_link.html" %}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="content-description">{{ flatpage.content|markdown('solution')|reference|str|safe }}</div>
|
||||
<div class="content-description">{{ flatpage.content|markdown|reference|str|safe }}</div>
|
||||
{% endblock %}
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "flatpages/markdown.html" %}
|
||||
|
||||
{% block body %}
|
||||
<div class="content-description">{{ flatpage.content|markdown('solution', MATH_ENGINE)|reference }}</div>
|
||||
<div class="content-description">{{ flatpage.content|markdown|reference }}</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyend %}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{{ preview_data|markdown('license') }}
|
||||
{{ preview_data|markdown }}
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "common-content.html" %}
|
||||
{% block description %}
|
||||
{% cache 3600 'license_html' license.id %}
|
||||
{{ license.text|markdown('license') }}
|
||||
{{ license.text|markdown }}
|
||||
{% endcache %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<div class="sidebox-content">
|
||||
<div style="margin: 0.3em;">
|
||||
{% cache 3600 'organization_html' organization.id MATH_ENGINE %}
|
||||
{{ organization.about|markdown('organization-about', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ organization.about|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<div class="sidebox-content">
|
||||
<div style="margin: 0.3em;">
|
||||
{% cache 3600 'organization_html' organization.id MATH_ENGINE %}
|
||||
{{ organization.about|markdown('organization-about', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ organization.about|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('organization-about', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -26,7 +26,7 @@
|
|||
<p>Authors: {{ link_users(authors) }}</p>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{{ solution.content|markdown('solution', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ solution.content|markdown|reference|str|safe }}
|
||||
</div>
|
||||
<hr>
|
||||
{% include "comments/list.html" %}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
{% endif %}
|
||||
<div class='blog-description content-description'>
|
||||
{% cache 86400 'problem_html' problem.id MATH_ENGINE LANGUAGE_CODE %}
|
||||
{{ problem.description|markdown("problem", MATH_ENGINE)|reference|str|safe }}
|
||||
{{ problem.description|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
{% if problem.pdf_description %}
|
||||
<embed src="{{url('problem_pdf_description', problem.code)}}" width="100%" height="500" type="application/pdf" style="margin-top: 0.5em">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('problem', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -376,7 +376,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% cache 86400 'problem_html' problem.id MATH_ENGINE LANGUAGE_CODE %}
|
||||
{{ description|markdown("problem", MATH_ENGINE)|reference|str|safe }}
|
||||
{{ description|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
|
||||
{% if problem.pdf_description %}
|
||||
|
@ -426,7 +426,7 @@
|
|||
<div class="problem-clarification">
|
||||
<div class="time">{{ relative_time(clarification.date) }}</div>
|
||||
<span class="body">
|
||||
{{ clarification.description|markdown('problem', MATH_ENGINE)|reference }}
|
||||
{{ clarification.description|markdown|reference }}
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
<head>
|
||||
<link rel="stylesheet" href="{{ static('style.css') }}">
|
||||
<link rel="stylesheet" href="{{ static('pygment-github.css') }}" type="text/css">
|
||||
<link rel="stylesheet" href="{{ static('markdown.css') }}">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="pygment-github.css" type="text/css">
|
||||
<link rel="stylesheet" href="markdown.css">
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style>
|
||||
html {
|
||||
|
@ -87,7 +90,7 @@
|
|||
</div>
|
||||
<hr style="clear: both;">
|
||||
<div class="content-description printing">
|
||||
{{ description|markdown('problem', 'tex')|reference|absolutify(url)|str|safe }}
|
||||
{{ description|markdown|reference|absolutify(url)|str|safe }}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="{{ static('mathjax_config.js') }}"></script>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('solution', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -47,7 +47,7 @@
|
|||
{% if language.description %}
|
||||
<div class="content-description">
|
||||
{% cache 86400 'language_html' language.id %}
|
||||
{{ language.description|markdown('language') }}
|
||||
{{ language.description|markdown }}
|
||||
{% endcache %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -20,6 +20,6 @@
|
|||
{{link_user(ticket.messages.last().user)}} {{_(' replied')}}
|
||||
</div>
|
||||
<div class='blog-description content-description'>
|
||||
{{ ticket.messages.last().body |markdown("ticket", MATH_ENGINE)|reference|str|safe }}
|
||||
{{ ticket.messages.last().body |markdown|reference|str|safe }}
|
||||
</div>
|
||||
</div>
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="content content-description">
|
||||
{{ message.body|markdown('ticket', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ message.body|markdown|reference|str|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('ticket', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -1,4 +1,4 @@
|
|||
{{ preview_data|markdown('self-description', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ preview_data|markdown|reference|str|safe }}
|
||||
{% if REQUIRE_JAX %}
|
||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
||||
{% endif %}
|
|
@ -82,7 +82,7 @@
|
|||
{% if user.about %}
|
||||
<h4>{{ _('About') }}</h4>
|
||||
{% cache 86400 'user_about' user.id MATH_ENGINE %}
|
||||
{{ user.about|markdown('self-description', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ user.about|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
{% else %}
|
||||
<i>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<div class="about-td">
|
||||
{% if user.about %}
|
||||
{% cache 86400 'user_about' user.id MATH_ENGINE %}
|
||||
{{ user.about|markdown('self-description', MATH_ENGINE)|reference|str|safe }}
|
||||
{{ user.about|markdown|reference|str|safe }}
|
||||
{% endcache %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue