text = form['savetext'].value
pg.send_editor(text)
+# Used by macros/WordIndex and macros/TitleIndex
def make_index_key():
links = map(lambda ch: '<a href="#%s">%s</a>' % (ch, ch), 'abcdefghijklmnopqrstuvwxyz')
- return '<p><center>'+ ' | '.join(links) + '</center></p>'
+ return '<p style="text-align: center">'+ ' | '.join(links) + '</p>'
def page_list(dirname = None, re = word_re):
return sorted(filter(re.match, os.listdir(dirname or data_dir)))
for word in all_words:
letter = word[0].lower()
if letter != last_letter:
- s = s + '; <a name="%s"><h3>%s</h3></a>' % (letter, letter)
+ s += '<a name="%s"><h3>%s</h3></a>' % (letter, letter)
last_letter = letter
- s = s + '<b>%s</b><ul>' % word
+ s += '<b>%s</b><ul>' % word
links = map[word]
links.sort()
last_page = None
for name in links:
if name == last_page: continue
- s = s + '<li>' + Page(name).link_to()
- s = s + '</ul>'
+ s += '<li>' + link_tag(name) + '</li>'
+ s += '</ul>'
return s