From: Bernie Innocenti
Date: Sat, 11 Apr 2009 13:45:21 +0000 (+0200)
Subject: Fix WordIndex and TitleIndex, improve HTML output
X-Git-Tag: v4.0~9^2~2
X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=f717244ea693c7882948b4758836e530169a6c11;p=geekigeeki.git
Fix WordIndex and TitleIndex, improve HTML output
---
diff --git a/geekigeeki.py b/geekigeeki.py
index 79f99ef..3eb4c1a 100755
--- a/geekigeeki.py
+++ b/geekigeeki.py
@@ -287,9 +287,10 @@ def handle_edit(pagename):
text = form['savetext'].value
pg.send_editor(text)
+# Used by macros/WordIndex and macros/TitleIndex
def make_index_key():
links = map(lambda ch: '%s' % (ch, ch), 'abcdefghijklmnopqrstuvwxyz')
- return ''+ ' | '.join(links) + '
'
+ return ''+ ' | '.join(links) + '
'
def page_list(dirname = None, re = word_re):
return sorted(filter(re.match, os.listdir(dirname or data_dir)))
diff --git a/macros/WordIndex.py b/macros/WordIndex.py
index 81cd0f9..818a884 100755
--- a/macros/WordIndex.py
+++ b/macros/WordIndex.py
@@ -17,15 +17,15 @@ def _macro_WordIndex(argv):
for word in all_words:
letter = word[0].lower()
if letter != last_letter:
- s = s + '; %s
' % (letter, letter)
+ s += '%s
' % (letter, letter)
last_letter = letter
- s = s + '%s' % word
+ s += '%s' % word
links = map[word]
links.sort()
last_page = None
for name in links:
if name == last_page: continue
- s = s + '- ' + Page(name).link_to()
- s = s + '
'
+ s += '- ' + link_tag(name) + '
'
+ s += '
'
return s