Contents
-
Parsers
-
Requests
- Dot Parser
- HTML Parser
- MySQL Parser
- Table header
- PHP Parser
- Align Parser
- Parser Priorities?
- embed parsers?
- Perl parser
- Markdown parser
- Textile parser
- Copy & Paste from Outlook, Word, Excel, etc
- VBcode/BBcode
- hide/show elements
- new colorizer
- Mealmaster Recipes
- Google Maps ?
- Regular Expression Colourizer?
- BASH/SH
- T/SQL
- PowerShell
-
Requests
Parsers
Requests
If you are not familiar with Python and/or the MoinMoin code base, but have a need or an idea for a parser, this is the place to ask for it. Someone might find it useful, too, and implement it.
Dot Parser
There's a dot processor for older MoinMoin, and AFIK that functionality is gone since processors are no longer supported. So I still have pages with dot diagrams that no longer draw. Is there a way to convert a processor into a parser?
HTML Parser
I'm trying to work out how to parse HTML source code, basically colourising it and adding line numbers as happens with parser/PHP. The HTML parsers on the market at the moment seem to actually parse the HTML and return to the browser. Is there already a parser that does what I'm after?
BTW - I've had a quick go at hacking together something based on Eduard Baun's PHP parser to do the job - any advice on this / whether this is the right way to work here would be appreciated. Thanks!
MySQL Parser
As per the HTML parser request above I am also looking to parse MySQL snippets in my documentation wiki. Any advice would be appreciated, thanks!
Table header
Does anybody know how to use "<=>" at a row to make it a header row (bold tex, gray background)? e.g.
Name |
Last name |
Joe |
Black |
PHP Parser
I tried to use the PHP parser listed above under version 1.3 and received an error that there is a syntax error on line 22. I do not know enough about python to fix it. Can anyone tell me what I need to do or update the php parser?
If it is that line starting with reserved_words please look if it is alligned to the same level as the lines before, it looks for me there are to much spaces before this var.
I checked it out, I can not seem to fix the syntax in any way that makes it work. I'm not familar with python, but I even attempted to re-write it without sucess. I simply ended up moving the line the sytax error was on.
Have a look at this PHP parser
Thank you very much, that worked perfectly!
I've tried getting Eduard Baun's PHP parser to work, but haven't had any luck. I copied the code on the parser page into ColorizedPhp.py and copied it into data/plugin/parser. Using a code display region as described in HelpOnParsers gave me a "No module named ParserBase" error. ColorizedPhp.py was not compiled, either. Using #FORMAT made ColorizedPhp.py compile, but it just displays the php code itself. See http://lascrucesacademy.org/wiki.cgi/TestPhp. Any help would be appreciated.
The location of ParserBase has changed in more recent versions. Change the import line in the PHP.py to MoinMoin.parser._ParserBase and it should work.
The PHP parser has been updated to work with newer versions, so if anyone's reading this it should now hopefully be a non-issue
Align Parser
Background: On FeatureRequests/BetterControlOverIncludedImages I have started a discussion with ReimarBauer, that it would be fine to have some better ways to align images in Moin. Reimar showed me, that you can do some alignment already by using tables and html-like commands. We both agreed, that this is poorly documented in Moin and that it is maybe the time to have a new help file like HelpOnImages. I have already started to collect code samples for that help file. Some code worked fine, others didn't. E.g. I could not center images on a page. Then I came up with the idea, to have some new marco ImageAlign so that the user gets rid of all that syntax stuff. Reimar now has come up with the idea, that I would be better, to solve that by introducing a new align parser.
Request: With the new align parser at hand, it should be easily possibel to align different objects on a wikipage like images, imagelinks, embeded objects, gallery2 objects, image maps and so on.
{ { { #!Align center [[ImageLink(image.png)]] } } }
When aligning things, you usually want to do the follwing
- Alignment-options:
- float_right: object is aligned to the right, text floats on the left around that object
- float_left
- float_center (this is not defined in css)
- right: object is aligned to the right, no text float
- left
- center
You would like to controll the size of the aligned objects. Up to now, you can't controll the size of an image, that is included via attachment:image.jpg. You also can't add a tooltip-help for that. You can only do that with ImageLink.
- When aligning things, you often want to put these objects into a box with a certain border and backgroundcolor (especially true for images)
- Maybe you would like to add some text underneath the object for description (either aligned right, centerd, left). For optical reasons, you want to split longer descriptions into several lines.
Discussion: Solving alignment problems by introducing a new parser is a great idea. Maybe for the unexperienced user, this coding is too complicated. Compare = Heading 1 = to the code above with the Shebang statment and so on. Other wikis for example do image align by the code as follows.
To include: {{image.png}} To resize: {{image.png?50*50}} To add a tooltip {{image.png |Tooltip text}} To align left {{image.png }} To align right {{ image.png}} To align center {{ image.png }} Float align is not supported
For more on that see already /Frame by ReimarBauer, who is faster in implementing a first prototyp than me in writing this request! -- OliverSiemoneit 2006-08-12 10:03:44
And do look at the SectionParser introduced by NirSoffer which may already solve some complex issues. -- ReimarBauer 2006-08-12 13:30:33
Parser Priorities?
- I have to nest parsers like
{{{#!Sorter delimiter=|,column=3,column_type=date,date_format=%d.%m.%Y,sort_dir=down * Topic [[BR]]'''|04.12.2006| - 08.12.2006''' Germany / Deadline {{{#!DeadlineMarker |30.06.2006|} } } ... } } }
However, I need the DeadlineMarker to be executed _before_ Sorter.
embed parsers?
Is it possible to embed one parser in another? For example, to use the MySQL parser to fetch the gant data for the Gant charts, although that would get ugly without some intermediary to format it. What is the best method for dynamically pulling data from other databases and systems and processing it for display in the wiki, like if you wanted to integrate dotProject or something? -- EvanLanglois
Perl parser
A Perl parser seems to be suspiciously absent (or am I just missing something). Basically something just like the other language parsers, just for Perl. -- JonathanDelgado 2005-09-16 19:17:24
Markdown parser
A parser for Markdown http://daringfireball.net/projects/markdown/ would be swell. Instiki uses it by default, many blogs use it, it is a lovely syntax.
Here ya go! Found via a simple Google search.
IMHO this is rather a mess than a markup. While offering some definitely nice looking stuff (like that underlined headline markup), it offers many alternatives for some markup (this is superfluous and doesn't make things easier). Finally, it compensates its incompleteness by just allowing html tags (and you have to use it, as it completely misses table markup). -- ThomasWaldmann 2005-07-19 06:44:13
It is a mess from a programmers point of view, however from a users point of view it has one very compelling feature: Text pasted in from email/forums/etc "just works" much of the time. As someone who spends a lot of time massaging random text into Moin pages this could potentially save me quite a lot of time. -- AdamShand
Could I add another big +1 on this. I've used a lot of different plain text formats (including moinmoin's of course) and have ended up using markdown a lot. Not only does it permit straight copy and paste from emails etc (as Adam mentions) but you can use it for most blogging software etc etc. This combination of widespread support + an excellent existing python markdown to html processor (http://www.freewisdom.org/projects/python-markdown/) make a strong case for having a parser. --RufusPollock 2006-07-26
I'd liketo add another +1 on this. Markdown is particularly clean and compatible with common formats (e.g. the email examples above). In addition, I think the ability to use HTML if needed is a useful fallback if needed, for example to do tables that contain multi-line cells (or other markup). HTML, while verbose, is at least more standard and familiar than the wiki+minipage hack that Moin currently supports.--RamonFelciano 2006-08-08
I've added a Markdown parser: ParserMarket/Markdown. Note that it does allow intermingled HTML. -- JasonFruit 2009-07-10 20:19:28
Textile parser
I am with ThomasWaldmann when he complains above about intermingled HTML. Plus, Textile http://www.textism.com/tools/textile/index.php seems to me a better syntax than Markdown. In particular, I find the _emphasis_ and *strong* rules much more adequate than either Moin's or Markdown's (honestly, the single quotes of c2's original syntax are a usability disaster). And it has table support. Here the Python parser http://dom.eav.free.fr. Somebody made it work with Moin 1.3, but on grepping Moin's source code I see no support for Textile. -- AlvaroTejero 2006-08-10 09:15:28
Copy & Paste from Outlook, Word, Excel, etc
Am I dumb for wanting a parser that allows a MoinMoin Wiki to happily accept text copied & pasted from Outlook, Word, Excel, etc? Or have I missed a simple way of allowing users to do this without demanding that they reformat all their text? Or just asking totally the wrong question?
For OOCalc and Excel - solution from PmWiki can be modified for MoinMoin. It uses special worksheet with macros.
In most Microsoft apps you can paste as plain text by going to the Edit menu and selecting Paste Special.... A new dialog opens that has a series of options, one of which is Plain text. Not exactly what you were looking for, but it might get you a little closer.
There is now a little Excel pasted table parser there at the end of the parsers for moinmoin1.3. The problem is that MoinMoin actually changes '\t' into spaces even inside the triple curly brace thingies. This is a big problem for Excel pasted data because Excel uses '\t' to delimit columns. So to use this parser you have to edit MoinMoin/parser/wiki.py and change rawtext=self.raw.expandtabs() to be rawtext=self.raw ... this may screw up some other formatting of code but i dont know.
For simple sheetsI use a dummy thing to move data from excel to MoinMoin: -- FerranBusquets
- I create a new cell on right of all the others with this format:
- {{
="|| "&A1&" || "&A2&" || " & ... &" ||"
- {{
For date fields remmember to use TEXT(F34;"DD/MM/YYYY")
- Copy the concatenation formula to all the bottom cells.
Select the new cells and Paste them to MoinMoin.
- I create a new cell on right of all the others with this format:
VBcode/BBcode
a Parser able to display VBcode/BBcode markup as used for content on a Web-based forum. This would be of use to forum users who need to create Wiki content also.
hide/show elements
- Can we have a format that allow hide/show of elements?
For example, if a underscore is appended to the heading _== heading ==_ then the sub-elements of it will be hide/show by clicking the heading. A close icon can also placed at the end of the text to hide it again.
I'm not too familiar with the MoinMoin codebase, but it sounds to me like what you want (e.g. what most modern editors call folding) would be achived with an Action. Can anyone confirm this? I have partially implemented this, please see my homepage -- JohannesBerg 2004-03-09 11:00:01
Actually, all you need is some CSS and JavaScript. A MoinMoin extension to implement this would wrap everything between Heading A and Heading B in a div and set an onClick handler for the header which toggles style="visibility: hidden;" on the div. -- StephanSokolow 2005-04-06 04:58:10
new colorizer
I am trying to use ParserBase to make a new colorizer. I want to add "foo bar" to ResWord (so a compound word containing the space char). Putting it in the list reserved_words (as it is done in cplusplus.py) does'nt work . It seesm that reserved_words should only contain single words without space. Am I right? How can I directly add that (or in general a regular expression) to ResWord. (I am just a beginner in Python.) -- زردشتر 2005-04-20 13:15:42
Mealmaster Recipes
It would be nice if one could import a recipe in Mealmaster format into a MoinMoin wiki.
- It shouldn't be too difficult to write an importer for that. You can use wiki xmlrpc to talk to the target wiki (see MoinMoin/scripts/xmlrpc/ samples). I would recommend 1 recipe per page using that MM "Title" as pagename. For the first implementation, maybe just use the plain parser to show the text as is and later either write a mealmaster parser or transform the content to wiki markup on import. You can make wiki categories out of the MM categories then.
ThiloPfennig/MealMaster - description of format
Google Maps ?
Hi, ist it possbile to integrate Google Maps into Moin? -- ThiloPfennig 2006-06-01 21:44:53
Regular Expression Colourizer?
It would be nice to have a regular expression coulourizer for articles about this topic. -- LedgerBob
BASH/SH
Anybody here use/doc (not-so) simple BASH or sh shell script ? -- PatrickCaoHuuthien
T/SQL
I am in desperate need of a T/SQL parser to display syntax colors in a wiki page. I'm sure that I'm not the only one out there that would find this useful. Thanks.
PowerShell
I am in need of a PowerShell parser to display syntax colors in a wiki page. I'm sure that I'm not the only one out there that would find this useful. Thanks.