Patch de Gregoire pour avoir les menus a la Wikipedia.
darcs-hash:20060430060948-68412-489189d9a632c612ac89782b47ed04d965656918.gz
This commit is contained in:
parent
f5395f74ef
commit
7d9932d360
1 changed files with 17 additions and 2 deletions
|
@ -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)
|
_arg_skipitems, _arg_titlesonly, _arg_editlink)
|
||||||
|
|
||||||
# from Include, too, but with extra htext group around header text
|
# 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:
|
class TableOfContents:
|
||||||
"""
|
"""
|
||||||
|
@ -75,7 +75,22 @@ class TableOfContents:
|
||||||
for i in range(self.baseindent, self.indent):
|
for i in range(self.baseindent, self.indent):
|
||||||
self.result.append(self.macro.formatter.listitem(0))
|
self.result.append(self.macro.formatter.listitem(0))
|
||||||
self.result.append(self.macro.formatter.number_list(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):
|
def process_lines(self, lines, pagename):
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue