-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust page layout to changes in plasTeX
- Loading branch information
1 parent
e8e7599
commit a839d37
Showing
2 changed files
with
176 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
leanblueprint/Packages/renderer_templates/document-layout.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
{% 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 type="text/x-mathjax-config"> | ||
{% if config.html5['mathjax-dollars'] %} | ||
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); | ||
{% else %} | ||
MathJax.Hub.Config({tex2jax: {inlineMath: [ ['\\(','\\)']]}}); | ||
{% 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 %} | ||
<li></li> | ||
<li> | ||
<a href="dep_graph.html">Dependency graph</a> | ||
</li> | ||
{% if 'project_home' in obj.ownerDocument.userdata %} | ||
<li> | ||
<a href="{{ obj.ownerDocument.userdata['project_home'] }}">Project home</a> | ||
</li> | ||
{% endif %} | ||
</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> |