{% extends "base.html" %}
{% block content %}
<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>
<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">

<meta id="text" data-text="{{data}}">
<div id="text_div"></div>

<script type="text/javascript">
  $(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);
  });
</script>    
{% endblock %}
 