Attachment 'AnchorLink-1.0.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - AnchorLink macro Version 1.0, 4.06.2013
   4     
   5     Syntax:
   6        <<AnchorLink(text)>>
   7        
   8     @copyright: 2013 Ian Riley <ian.riley@internode.on.net>
   9     license: GNU GPL, see COPYING for details.
  10 
  11 """
  12 
  13 from MoinMoin import wikiutil
  14 
  15 def execute(macro, args):
  16     text = args
  17     result = []  
  18     
  19     if text:
  20         anchor = text
  21         if '|' in text:
  22             anchor, text = text.split('|', 1)
  23         result.extend([
  24             '\n',
  25             macro.formatter.anchorlink(1, anchor),
  26             macro.formatter.text(text),
  27             macro.formatter.anchorlink(0),
  28         ])
  29 
  30     return ''.join(result)

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