Attachment 'MiniPage-1.8.4-6.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - MiniPage Macro
   4 
   5     PURPOSE:
   6         This macro is used to get the possibility to write inside a wiki table normal wiki code.
   7 	This code is parsed by the wiki parser and is then displayed.
   8 
   9     CALLING SEQUENCE:
  10         [[MiniPage(wikicode)]]
  11 
  12     INPUTS:
  13         wikicode: e.g. * item1
  14     EXAMPLE:
  15        ||Buttons ||[[MiniPage( * Redo\n * Undo)]][[MiniPage( * Quit)]]||
  16        ||Section ||[[MiniPage(= heading 1 =)]][[MiniPage(== heading 2 ==)]]||
  17 
  18     PROCEDURE:
  19        The \n mark is used for a line break.
  20 
  21        Please remove the Version number from the code!
  22 
  23     MODIFICATION HISTORY:
  24         Version 1.3.3-1
  25         Version 1.3.3-2 Updated for Moin1.6
  26         Version 1.6.0-3 refactored
  27         Version 1.7.1-5 refactored for 1.7
  28         Version 1.8.4-6 refactored for 1.8.4 added parameter escaping
  29         @copyright: 2005-2008 by Reimar Bauer (R.Bauer@fz-juelich.de)
  30         @copyright: 2011 by Remco Boerma (r.boerma@drenthecollege.nl)
  31         @license: GNU GPL, see COPYING for details.
  32 
  33 """
  34 from MoinMoin import wikiutil
  35 
  36 def macro_MiniPage(macro,text):
  37      #unescape = and , to get rid of parameter processing
  38      text = text.replace('=','=').replace(',',',')
  39      #unescape \n  
  40      text = text.replace('\\n', '\n')
  41      # get the required references
  42      request = macro.request
  43      parser = wikiutil.searchAndImportPlugin(request.cfg, "parser", request.page.pi['format'])
  44      # return wikified text
  45      return wikiutil.renderText(request,parser,text)

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2005-03-19 09:28:07, 1.1 KB) [[attachment:MiniPage-1.3.3-1.py]]
  • [get | view] (2007-02-19 14:06:51, 1.2 KB) [[attachment:MiniPage-1.6.0-2.py]]
  • [get | view] (2008-01-25 10:00:07, 1.2 KB) [[attachment:MiniPage-1.6.0-4.py]]
  • [get | view] (2008-08-04 17:39:28, 1.2 KB) [[attachment:MiniPage-1.7.1-5.py]]
  • [get | view] (2011-04-21 07:51:38, 1.5 KB) [[attachment:MiniPage-1.8.4-6.py]]
  • [get | view] (2005-03-21 23:26:54, 6.4 KB) [[attachment:minipage.png]]
 All files | Selected Files: delete move to page copy to page

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