-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Expand file tree
/
Copy pathcustomlocaltoc.html
More file actions
29 lines (28 loc) · 720 Bytes
/
customlocaltoc.html
File metadata and controls
29 lines (28 loc) · 720 Bytes
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
{#
Customization of sphinx's basic/localtoc.html
- When present, display links to the parent pages within sections,
rather than link to the global contents
- When parents are absent, display a link to the document root using the docstitle
#}
<div>
<div>
{%- if parents %}
{%- for parent in parents %}
<h{{ loop.index0 + 3 }}>
<a href="{{ parent.link|e }}"
title="{{ parent.title }}">
{{ parent.title }}
</a>
</h{{ loop.index0 + 3 }}>
{%- endfor %}
{%- else %}
<h3>
<a href="{{ pathto(root_doc)|e }}"
title="{{ docstitle|e }}">
{{ docstitle|e }}
</a>
</h3>
{%- endif %}
</div>
{{ toc }}
</div>