changeset 584:7a22cd126aa4

merged repos
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 16 Mar 2012 09:10:20 +0100
parents 5726458585d7 (diff) 374033c4eb26 (current diff)
children d6a7c36f06f5
files
diffstat 2 files changed, 96 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/plugin/macro/MiniPage.py	Fri Mar 16 09:10:20 2012 +0100
@@ -0,0 +1,21 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - MiniPage Macro
+    
+    This macro is used to write multi line markup into a table. 
+    Add a linefeed for a new line e.g.
+    ||Buttons ||[[MiniPage( * Redo\n * Undo)]][[MiniPage( * Quit)]]||
+    ||Section ||[[MiniPage(= heading 1 =)]][[MiniPage(== heading 2 ==)]]||
+        
+    @copyright: 2005-2012 by MoinMoin:ReimarBauer
+    @license: GNU GPL, see COPYING for details.
+"""
+from MoinMoin import wikiutil
+
+def execute(macro, text):
+     request = macro.request
+     text = ''.join(text)
+     text = text.replace('\\n', '\n')
+     Parser = wikiutil.searchAndImportPlugin(request.cfg, "parser", request.page.pi['format'])
+     return wikiutil.renderText(request, Parser, text)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/plugin/parser/text_x_sort.py	Fri Mar 16 09:10:20 2012 +0100
@@ -0,0 +1,75 @@
+#-*- coding: utf-8 -*-
+""" 
+sort to sort one level of input
+===================================
+
+This parser is used to sort text lines
+    
+
+Install
+-------
+
+remove the version number 
+Put it in your wiki/data/plugin/parser/
+
+
+Example
+-------
+
+{{{
+#!sort
+ * B
+ * A
+ * D
+ * C
+}}}
+ 
+
+Result::
+
+ * A
+ * B
+ * C
+ * D
+    
+
+Legal
+-----
+@copyright 2005-2012 MoinMoin:ReimarBauer
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+"""
+
+from MoinMoin.parser import text_moin_wiki as wiki
+
+Dependencies = []
+
+
+class Parser:
+
+    def __init__(self, raw, request, **kw):
+        self.raw = raw
+        self.request = request
+        self.form = request.form
+        self._ = request.getText
+
+
+    def format(self, formatter):
+        raw = self.raw.split('\n')
+        raw.sort()
+
+        wikiizer = wiki.Parser('\n'.join(raw), self.request)
+        wikiizer.format(formatter)
+