From 3c3f1b102838ff02e02d8b06ecc0b1df6feb4f48 Mon Sep 17 00:00:00 2001 From: glondu Date: Sun, 30 Apr 2006 09:20:50 +0200 Subject: [PATCH] C'est plus propre comme ca. darcs-hash:20060430072050-68412-cad6875288c8c6f02d65781652b70c8c71f94297.gz --- wiki/macro/TableOfContents.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/wiki/macro/TableOfContents.py b/wiki/macro/TableOfContents.py index 8c267faf..0e208306 100644 --- a/wiki/macro/TableOfContents.py +++ b/wiki/macro/TableOfContents.py @@ -5,6 +5,7 @@ Optional integer argument: maximal depth of listing. @copyright: 2000, 2001, 2002 by Jürgen Hermann + @copyright: 2006 by Grégoire Détrez @license: GNU GPL, see COPYING for details. """ @@ -78,16 +79,22 @@ class TableOfContents: try: html = [ - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u'

Sommaire

'), - self.macro.formatter.rawHTML(u'
'), - ''.join(self.result), - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u''), + self.macro.formatter.open('div', True, {'id': 'tableOfContents'}), + self.macro.formatter.open('h2', False, {'id': 'toctitle'}), + self.macro.formatter.text(u'Sommaire'), + self.macro.formatter.close('h2', True), + self.macro.formatter.open('div', True, {'id': 'tableOfContentsList'}), + ''.join(self.result), + self.macro.formatter.close('div', True), + self.macro.formatter.close('div', True), + self.macro.formatter.open('div', False, {'class': 'visualClear'}), + self.macro.formatter.close('div', True), + self.macro.formatter.open('script', False, + {'type': 'text/javascript', + 'src': '/wiki/common/toc/toc.js'}), + self.macro.formatter.close('script', True), ] - return u'\n'.join(html) + return u''.join(html) except: return ''.join(self.result)