view docs/templates/doc.html @ 440:32c7c2d219d2

performance: Refactor how data is managed to reduce copying. * Make use of `collections.abc.Mapping` to better identify things that are supposed to look like dictionaries. * Instead of handling "overlay" of data in a dict tree in each different data object, make all objects `Mapping`s and handle merging at a higher level with the new `MergedMapping` object. * Since this new object is read-only, remove the need for deep-copying of app and page configurations. * Split data classes into separate modules.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 28 Jun 2015 08:22:39 -0700
parents 8140ff806258
children 61d53d2163d6
line wrap: on
line source

{% extends "default.html" %}

{% macro pagelink(title, url) -%}
    <a href="{{url}}"{% if url == page.url %} class="active"{% endif %}>{{title}}</a>
{%- endmacro %}

{% block head %}
{% if page.needs_pygments %}
    <style type="text/css">
    {{highlight_css()}}
    </style>
{% endif %}
{% endblock %}

{% block header %}
<header class="documentation">
    <h1>{{ page.title }}</h1>
</header>
{% endblock %}

{% block content %}
<div class="container">
    <section class="col-md-8">
    {{ content|safe }}
    </section>
    <aside class="col-md-4">
        <ul class="doc-level1">
        {% for p in family.root %}
        {% if p.is_dir and p.is_page %}
            <li>{{ pagelink(p.title, p.url) }}
                <ul class="doc-level2">
                {% for p2 in p.children %}
                    <li>{{ pagelink(p2.title, p2.url) }}</li>
                {% endfor %}
                </ul>
            </li>
        {% elif not p.is_dir and p.order %}
            <li>{{ pagelink(p.title, p.url) }}</li>
        {% endif %}
        {% endfor %}
        </ul>
    </aside>
</div>
{% endblock %}