Attachment 'freemind.py'
Download 1 """
2 MoinMoin - Freemind Text Parser
3
4 Copyright (c) 2006 by Ben Kavanagh
5 All rights reserved, see COPYING for details.
6
7 """
8
9 from MoinMoin import wikimacro
10
11 class Parser:
12 """
13 Send HTML code raw
14 """
15
16 def __init__(self, raw, request, **kw):
17 self.raw_text = raw
18 self.request = request
19 self.form = []
20
21
22 # All freemind parser does is ignore text and add a FreeMindBrowser section with
23 # url pointing to this page with action=getmmap.
24 # getmmap action simply uses regular expression to grap first {{{#!freemind <map..> .. </map>}}}
25 # section in page.
26 # improvements would be to add identifier. This gives weight to the argument for merging
27 # macros/processors/parsers.
28
29 def format(self, formatter):
30 """ Send the "parsed" text.
31 """
32
33 mmapUrl = "http://" + self.request.url + "?action=getmmap"
34
35 # create macro instance
36 macro_obj = wikimacro.Macro(self)
37
38 # formatter.macro calls "return macro_obj.execute(name, args)"
39 self.html = formatter.macro(macro_obj, "FreeMindBrowser", mmapUrl)
40
41 self.request.write(self.html)
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.You are not allowed to attach a file to this page.