# nav.myt - Provides page navigation elements that are derived from toc.TOCElement structures, including # individual hyperlinks as well as navigational toolbars and table-of-content listings. <%namespace name="tocns" file="toc.html"/> <%def name="itemlink(item, anchor=True, extension='html')" filter="trim"> ${ item.description } <%def name="toclink(toc, path, description=None)" filter="trim"> <% item = toc.get_by_path(path) if description is None: if item: description = item.description else: description = path %> % if item: ${ description } % else: ${ description } % endif <%def name="link" filter="trim(href, text, class_)"> ${ text } <%def name="topnav(item, extension='html')"> Table of Contents
% if item.previous is not None: Previous: ${itemlink(item=item.previous, anchor=False)} % endif % if item.previous is not None and item.next is not None:   |   % endif % if item.next is not None: Next: ${itemlink(item=item.next, anchor=False)} % endif
${ item.description } ${tocns.printtoc(root=item, current=None, full=True, anchor_toplevel=True)} <%def name="pagenav(item)"> % if item.previous is not None: Previous: ${itemlink(item=item.previous)} % endif % if item.next is not None: ${item.previous is not None and "|" or ""} Next: ${itemlink(item=item.next)} % endif