1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
{% set links = obj.links %}
{% set doc = obj.ownerDocument.getElementsByTagName('document')[0] %}
{% set toc = doc.tableofcontents if config.html5['display-toc'] else None %}
{% set rendererdata = obj.ownerDocument.rendererdata['html5'] %}
{% macro tocEntry(section) %}
<span class="toc_ref">{{ section.ref.textContent }}</span> <span class="toc_entry">{{ section.tocEntry }}</span>{% endmacro %}
{% macro isActive(section) %}
{% if section in links.breadcrumbs %} active{% endif %}
{% endmacro %}
{% macro isCurrent(section) %}
{% if section.url == obj.url %} current{% endif %}
{% endmacro %}
{% macro icon(icon, id='', class='') %}
<svg {% if id %}id="{{id}}" {% endif %}class="icon icon-{{ icon }} {{ class }}"><use xlink:href="symbol-defs.svg#icon-{{ icon }}"></use></svg>
{% endmacro %}
<!DOCTYPE html>
<html lang="en">
<head>
{% if config.html5['use-mathjax'] %}
<script>
MathJax = {
tex: {
{% if config.html5['mathjax-dollars'] %}
inlineMath: [['$','$'], ['\\(','\\)']]
{% else %}
inlineMath: [['\\(','\\)']]
{% endif %}
{% if config['mathjax-macros']['macros'] %}
macros: { {% for key, val in config['mathjax-macros']['macros'].items() %}
{{ key }}: {{ val }},
{% endfor %}
}
{% endif %}
} }
</script>
<script type="text/javascript" src="{{ config.html5['mathjax-url'] }}">
</script>
{% endif %}
<meta name="generator" content="plasTeX" />
<meta charset="{{ config.files['output-encoding']}}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{% if obj.title %}
{% if obj.level > config.html5['localtoc-level'] %}
<title>{{ links.document.title }}: {{ obj.title }}</title>
{% else %}
<title>{{ obj.title }}</title>
{% endif %}
{% endif %}
{% if links.next.url %}
<link rel="next" href="{{ links.next.url }}" title="{{ links.next.title.textContent }}" />
{% endif %}
{% if links.prev.url %}
<link rel="prev" href="{{ links.prev.url }}" title="{{ links.prev.title.textContent }}" />
{% endif %}
{% if links.up.url %}
<link rel="up" href="{{ links.up.url }}" title="{{ links.up.title.textContent }}" />
{% endif %}
{% for css in rendererdata.get('css', []) %}
<link rel="stylesheet" href="styles/{{ css }}" />
{% endfor %}
</head>
<body>
{% if toc %}
<header>
{% if toc %}{{ icon('list-numbered', id='toc-toggle')}}{% endif %}
</header>
{% endif %}
<div class="wrapper">
{% if toc %}
<nav class="toc">
<ul class="sub-toc-0">
{% for section in toc recursive %}
<li class="{{ isActive(section) }}{{ isCurrent(section) }}">
{% if section.tableofcontents %}
<a href="{{ section.url }}">{{ tocEntry(section) }}</a>
<span class="expand-toc">{% if isActive(section) %}▼{% else %}▶{% endif %}</span>
<ul class="sub-toc-{{loop.depth}}{{ isActive(section) }}">
{{ loop(section.tableofcontents) }}
</ul>
{% else %}
<a href="{{ section.url }}">{{ tocEntry(section) }}</a>
{% endif %}
</li>
{% endfor %}
{% for item in rendererdata.get('extra_toc_items', []) %}
<li {% if item.url == obj.url %}class="current"{% endif %}><a href="{{ item.url }}">{{ item.text }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
<div class="content">
<div class="content-wrapper">
{% if obj.level >= config.html5['breadcrumbs-level'] %}
<ul class="breadcrumbs">
{% for crumb in links.breadcrumbs %}
{% if loop.last %}
<li class="last_crumb">{{ crumb.title }}</li>
{% else %}
<li class="crumb"><a href="{{ crumb.url }}" class="crumb">{{ crumb.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
<div class="main-text">
{{ obj }}
</div> <!--main-text -->
{% if obj.tableofcontents and obj.level <= config.html5['localtoc-level'] %}
<nav class=local_toc>
<ul>
{% for section in obj.tableofcontents recursive %}
<li>
<a href="{{ section.url }}">{{ tocEntry(section) }}</a>
{% if section.tableofcontents %}
<ul>
{{ loop(section.tableofcontents) }}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
{% if obj.footnotes %}
<footer id="footnotes">
<ol>
{% for footnote in obj.footnotes %}
<li id="{{ footnote.id }}">{{ footnote }}</li>
{% endfor %}
</ol>
</footer>
{% endif %}
</div> <!-- content-wrapper -->
</div> <!-- content -->
</div> <!-- wrapper -->
<nav class="prev_up_next">
{% for nav in rendererdata.get('extra-nav', []) %}
{{ icon(nav['icon'], id=nav['id'], class=nav['class']) }}
{% endfor %}
{% if links.prev.url %}
<a href="{{ links.prev.url }}" title="{{ links.prev.title | striptags }}">{{ icon('arrow-left')}}</a>
{% endif %}
{% if links.up.url %}
<a href="{{ links.up.url }}" title="{{ links.up.title | striptags }}">{{ icon('arrow-up')}}</a>
{% endif %}
{% if links.next.url %}
<a href="{{ links.next.url }}" title="{{ links.next.title | striptags }}">{{ icon('arrow-right')}}</a>
{% endif %}
{% if links.index.url %}
<a href="{{ links.index.url }}" class="index">Index</a>
{% endif %}
</nav>
{% for js in rendererdata.get('js', []) %}
<script type="text/javascript" src="js/{{ js }}"></script>
{% endfor %}
</body>
</html>
|