Files

32 lines
1.0 KiB
HTML
Raw Permalink Normal View History

2022-10-02 20:18:05 +09:00
{% extends "base.html" %}
{% block content %}
2025-12-25 19:42:32 +09:00
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?autorun=true&amp;lang=css&lang=python&skin=sunburst"></script>
2022-10-02 20:18:05 +09:00
2025-12-25 19:42:32 +09:00
<script src="{{ url_for('static', filename='js/showdown_2.1.0.js') }}"></script>
<script src="{{ url_for('static', filename='js/showdown-prettify.js') }}"></script>
<link href="{{ url_for('static', filename='css/showdown.css') }}" rel="stylesheet">
2022-10-02 20:18:05 +09:00
2025-12-25 19:42:32 +09:00
<meta id="text" data-text="{{data}}">
<div id="text_div"></div>
2022-10-02 20:18:05 +09:00
<script type="text/javascript">
2025-12-25 19:42:32 +09:00
$(document).ready(function(){
var converter = new showdown.Converter({extensions: ['prettify']});
converter.setOption('tables', true);
converter.setOption('strikethrough', true);
converter.setOption('ghCodeBlocks',true);
text = $('#text').data('text');
if (window.location.href.endsWith('.yaml')) {
text = "```" + text + "```";
}
html = converter.makeHtml(text);
$('#text_div').html(html);
});
2022-10-02 20:18:05 +09:00
</script>
{% endblock %}