diff options
Diffstat (limited to 'templates/page.mako')
-rw-r--r-- | templates/page.mako | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/templates/page.mako b/templates/page.mako index 4670764..625a05c 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -2,25 +2,23 @@ title = "" uses_toc = False %> +<% + page_text = capture(next.body) +%> <%inherit file="/root.mako" /> -<h1 class="title">${self.attr.title}</h1> -${next.body()} +## content +<h1 class="title">${self.attr.title}</h1> % if self.attr.uses_toc: - <script type="text/javascript"> - createToc(${h.toJS(self.attr.tlist)}) - </script> + ${self.preface()} + ${self.toc()} % endif +${page_text} -<%def name="style()"> - ${parent.style()} - % if self.attr.uses_toc: - <script src=${"/static/js/toc.js" | url} type="text/javascript"></script> - % endif -</%def> +## functions <%def name="h2()"> <% @@ -38,13 +36,11 @@ ${next.body()} </%def> <%def name="toc()"> - <div id="toc"> - <noscript class="box"> - Enable JavaScript for a table of contents. - </noscript> - </div> - <noscript> - <!-- dummy paragraph to get the correct layout in noscript mode --> - <p></p> - </noscript> + <ul id="toc"> + % for url, name in self.attr.tlist: + <li><a class="tocLink" href="#${url}">${name}</a></li> + % endfor + </ul> </%def> + +<%def name="preface()"></%def> |