Attachment 'PageBreak-1.2.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - PageBreak macro Version 1.2, 9.02.2013
   4     
   5     Syntax:
   6        <<PageBreak>>; <<PageBreak()>> 
   7        <<PageBreak(text)>>
   8        
   9     @copyright: 2012-2013 Ian Riley <ian@riley.asia>
  10     license: GNU GPL, see COPYING for details.
  11 
  12 """
  13 
  14 from MoinMoin import wikiutil
  15 
  16 def execute(macro, args):
  17     text = args
  18     if not text:
  19         text = '&nbsp;' #added for functionality with wkhtmltopdf
  20     else:
  21         text = wikiutil.escape(text) # make sure nothing harmful
  22     if macro.request.action == 'print':
  23         result = '<p style="page-break-after: always">%s</p>' % (text)
  24     else:
  25         result = ''
  26     return result

You are not allowed to attach a file to this page.