Commit 7d9932d3 authored by glondu's avatar glondu

Patch de Gregoire pour avoir les menus a la Wikipedia.

darcs-hash:20060430060948-68412-489189d9a632c612ac89782b47ed04d965656918.gz
parent f5395f74
......@@ -29,7 +29,7 @@ _args_re_pattern = r'^(?P<name>[^,]+)(%s(%s)?%s%s%s%s%s%s%s)?$' % (
_arg_skipitems, _arg_titlesonly, _arg_editlink)
# from Include, too, but with extra htext group around header text
_title_re = r"^(?P<heading>\s*(?P<hmarker>=+)\s(?P<htext>.*)\s(?P=hmarker))$"
_title_re = r"^(?P<heading>(?P<hmarker>=+)\s(?P<htext>.*)\s(?P=hmarker))$"
class TableOfContents:
"""
......@@ -75,7 +75,22 @@ class TableOfContents:
for i in range(self.baseindent, self.indent):
self.result.append(self.macro.formatter.listitem(0))
self.result.append(self.macro.formatter.number_list(0))
return '\n'.join(self.result)
try:
html = [
self.macro.formatter.rawHTML(u'<div id="tableOfContents">'),
self.macro.formatter.rawHTML(u'<h2 id="toctitle">Sommaire</h2>'),
self.macro.formatter.rawHTML(u'<div id="tableOfContentsList">'),
''.join(self.result),
self.macro.formatter.rawHTML(u'</div>'),
self.macro.formatter.rawHTML(u'</div>'),
self.macro.formatter.rawHTML(u'<div class="visualClear"></div>'),
self.macro.formatter.rawHTML(u'<script type="text/javascript" src="/wiki/common/toc/toc.js"></script>'),
]
return u'\n'.join(html)
except:
return ''.join(self.result)
def process_lines(self, lines, pagename):
for line in lines:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment