<!DOCTYPE html>
{% load static compress %}

<head>
    <title>
        {% block title %}
        {% endblock %}
    </title>
    {% compress js file thirdparty %}
    <script type="text/javascript" src="{% static 'documentation/js/3rdparty/showdown.js' %}"></script>
    <script type="text/javascript" src="{% static 'documentation/js/3rdparty/showdown-toc.js' %}"></script>
    {% endcompress %}
</head>

<body>
    <xmp id=content style="display: none;">
        {% autoescape off %}
        {% block content %}
        {% endblock %}
        {% endautoescape %}
    </xmp>
    <script type="text/javascript">
        var converter = new showdown.Converter({extensions: ['toc']});
        converter.setFlavor('github');
        var user_guide = document.getElementById("content").innerHTML;
        // For GitHub documentation we need to have relative links without
        // leading slash. Let's just add the leading slash here to have correct
        // links inside online documentation.
        user_guide = user_guide.replace(/!\[\]\(static/g, "![](/static")
        document.body.innerHTML = converter.makeHtml(user_guide);
    </script>
</body>
