1 def emit_footnotes(request, formatter):
   2     # emit collected footnotes
   3     if request.footnotes:
   4         result = []
   5         result.append('<div class="footnotes">')
   6         result.append('<div></div><ul>')
   7         for idx in range(len(request.footnotes)):
   8             fn_id = request.footnotes[idx][1]
   9             fn_no = formatter.anchorlink('fnref' + fn_id, str(idx+1), id = 'fndef' + fn_id)
  10 
  11             result.append('<li><span>')
  12             result.append(fn_no + '</span> ')
  13             
  14             from MoinMoin.parser import wiki
  15             from MoinMoin.formatter import text_html
  16             parser = wiki.Parser(request.footnotes[idx][0], request)
  17             parser.formatInMemory(formatter)
  18 
  19             result.append(parser.formatInMemory(formatter))
  20             result.append('</li>')
  21         result.append('</ul></div>')
  22         request.footnotes = []
  23         return ''.join(result)
  24 
  25     return ''

MoinMoin: JosYule/FootNotesCode (last edited 2007-10-29 19:16:44 by localhost)