diff options
Diffstat (limited to 'templates/page.mako')
-rw-r--r-- | templates/page.mako | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/page.mako b/templates/page.mako index cc3f480..9e1f20f 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -17,14 +17,16 @@ ${next.body()} <%def name="style()"> ${parent.style()} - <script src=${"/static/js/toc.js" | url} type="text/javascript"></script> + % if self.attr.uses_toc: + <script src=${"/static/js/toc.js" | url} type="text/javascript"></script> + % endif </%def> <%def name="h2()"> <% if self.attr.uses_toc: c = capture(caller.body) - name = c.replace(" ", "_").lower() + name = c.replace(" ", "_").replace("/", "_").lower() tlist = getattr(self.attr, "tlist", []) tlist.append((str(name), str(c))) @@ -34,3 +36,7 @@ ${next.body()} %> <h2><a name="${name}"><span class="hstart">» </span></a>${caller.body()}</h2> </%def> + +<%def name="toc()"> + <div id="toc"></div> +</%def> |